Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for Docker setup #1430

Draft
wants to merge 41 commits into
base: develop
Choose a base branch
from
Draft

Improvements for Docker setup #1430

wants to merge 41 commits into from

Conversation

Oaphi
Copy link
Member

@Oaphi Oaphi commented Oct 12, 2024

Closes #1398

This PR is an overhaul of our Docker setup to make it more flexible and resilient. It includes:

  • change of container restart policy to on-failure:3 (meaning 3 consequent failures cause containers to exit). Our current policy of always sends containers in a restart loop if there is a fatal error, making it hard to debug and resolve issues;
  • removed obsolete version field from docker-compose (just getting rid of an annoying warning);
  • removed mention of sleep command from Docker docs as there is none (probably legacy?);
  • removed manual installation of imagemagick in the container as it comes packed with ruby-3.1.2-bullseye;
  • added Dockerfile.dev for setting up Docker specifically for local development purposes;
  • added Dockerfile.arm for aarch64-specific setup out of the box;
  • upgraded Ruby image to 3.1.2-bullseye (matches our production setup in version);
  • when built with Dockerfile.dev, the uwsgi container no longer automatically starts Rails when run;
  • made Dockerfile configurable via .env (automatically created by local-setup.sh from compose-env).

Rationale for no longer auto-starting Rails when building with Dockerfile.dev:

  • allows for live debugging in case there are issues that cause hard failures (currently, the container exits);
  • prevents restart loops in case of hard failures (partially mitigated already by the restart policy change);
  • the additional step (connecting to the container & running a single command) is fully documented in README.md.

Rationale for making Dockerfile used for the uwsgi container configurable:

  • allows use of custom Docker build configurations as one sees fit as long as they set the CLIENT_DOCKERFILE environment variable;
  • required to facilitate the use of Dockerfile.dev for development setups without the need to hard-code the changes;
  • is backwards-compatible due to the default value of compose-env set to docker/Dockerfile;

@Oaphi Oaphi added complexity: average Not particularly hard, not particularly trivial. area: deployment Issues in setting up qpixel, containers, etc. labels Oct 12, 2024
@Oaphi Oaphi self-assigned this Oct 12, 2024
@Oaphi Oaphi requested review from ArtOfCode- and a team November 14, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: deployment Issues in setting up qpixel, containers, etc. complexity: average Not particularly hard, not particularly trivial.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker configuration needs changes to work on Mac (M1+)
1 participant