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

feat(docker): Allow dotcom-1 and dotcom-2 start in parallel in docker compose #2188

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

joshlarson
Copy link
Contributor

@joshlarson joshlarson commented Oct 4, 2024

The current setup has dotcom-2 wait for dotcom-1 to finish starting up before it even starts trying. This PR speeds up docker compose startup time, since it doesn't force dotcom-2 to wait anymore.

Before

flowchart LR
    dotcom-1 --> dotcom-2 --> nginx
Loading

After

flowchart LR
    dotcom-1 --> nginx
    dotcom-2 --> nginx
Loading

Historical context

  • Looks like the chaining was added in Chain service launch to reduce conflicts #1951 in order to keep the parallel elixir ... mix phx.server processes from stepping on each other. That's because they were both (under the hood) running mix deps.compile and writing to the same _build directory, which was mounted in by docker-compose.
  • But with the changes introduced in fix: Don't overwrite dep directories in docker-compose'ed containers #2182, dotcom-1 and dotcom-2 aren't sharing the same _build directory anymore, and mix deps.compile is run as part of building the image, which means it doesn't happen again when the containers are starting up, so chaining is no longer necessary.

@joshlarson joshlarson requested a review from a team as a code owner October 4, 2024 21:43
@joshlarson joshlarson enabled auto-merge (squash) October 4, 2024 22:22
@joshlarson joshlarson merged commit c066b8f into main Oct 7, 2024
17 checks passed
@joshlarson joshlarson deleted the jdl/let-dotcom-1-and-2-start-in-parallel branch October 7, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants