Add Docker Compose profiles for dev, full, test and integration - #657
Open
daveades wants to merge 1 commit into
Open
Add Docker Compose profiles for dev, full, test and integration#657daveades wants to merge 1 commit into
daveades wants to merge 1 commit into
Conversation
docker-compose.test.yml is absorbed into docker-compose.yml so --profile test works against the default file. Every service now names a profile, so plain docker compose up starts nothing. Two things the merge exposed: api-test sat on stellar-test-net while postgres-test sat on the default network, so it could never resolve its own database. Both are on one network now. Dockerfile.test ran npm ci before copying the prisma directory, and the postinstall hook is prisma generate, so the image could not build.
|
@daveades is attempting to deploy a commit to the Abdulazeem's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@daveades Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #606
docker-compose.test.ymlis absorbed intodocker-compose.ymlso thatdocker compose --profile test upworks against the default file, which is what the issue asks for. Every service now names a profile, so a baredocker compose upstarts nothing and you always say which stack you want.docker compose --profile dev updocker compose --profile full updocker compose --profile test updocker compose --profile integration upTwo splits are worth explaining.
The frontend is in
full, notdev. The issue asks for dev to be app + postgres + redis, and the Vite build is by far the slowest thing in the file.fullisdevplus the frontend, so nobody doing backend work pays for a UI build. The dev services belong to both profiles, so--profile fullstill resolvesfrontend'sdepends_on: backend.stellar-standaloneis inintegration, nottest. It pullsstellar/quickstart, a multi-gigabyte image used only by the Soroban contract tests undertests/integration/. Putting it intestwould drag it into every API test run.Dev and test use separate databases on separate host ports (5432 and 5433), so both stacks can run at once.
Two things the merge exposed
api-testcould never reach its own database. It declarednetworks: [stellar-test-net]whilepostgres-testhad nonetworkskey and so sat on the default network, makingpostgres-test:5432unresolvable. Rendering the old file shows the split:Both are on one network now, and the custom network is gone since nothing else needed it.
Dockerfile.testcould not build. It rannpm ciwith onlypackage*.jsoncopied, butpostinstallisprisma generate:Copying
prisma/beforenpm cifixes it, which is what the mainDockerfilealready does for the backend target.EXPOSEalso said 5000 while the service runs on 5001.Both of these had to be fixed for the test profile to be worth anything.
Also updated
tests/integration/{run.sh,deploy.sh,README.md}referenceddocker compose -f docker-compose.test.yml up -d stellar-standalone; they now use--profile integration. The.dockerignorecomment pointing at the removed file is updated too.The README gains a "Docker Compose profiles" section with the table above, the both-stacks-at-once command,
COMPOSE_PROFILES, and a note that you must pass the same profile todown.Verification
Docker is not available in my environment, so I validated with the standalone Compose v2 binary, which resolves profiles without a daemon. Every profile renders exactly the intended service set, and nothing renders by default:
All four profiles together parse clean, and dev + test have no host port collisions.
The
npm cifailure and its fix were both reproduced directly, outside Docker, by running the same install against the samepackage-lock.jsonwith and withoutprisma/present.What I could not verify is the actual image builds and container startup, since that needs a daemon. The layer-ordering fix is confirmed at the npm level only.
Backend suite unchanged: 51 suites, 859 tests. Markdown passes cspell.