Repository navigation
Make the Compose stack's ports configurable - #26
Merged
Merged
Conversation
Two copies of the stack, or adm and another project, could not run at once on one machine: every host port was fixed, and so was every container name. Each published port now comes from an ADM_*_PORT variable, which docker compose reads from the environment or from .env, defaulting to the port it used before. Keycloak's frontend URL and redirect URIs, and the app's KEYCLOAK_FRONTEND_SERVER_URL and FRONTEND_SERVER_URL, follow ADM_KEYCLOAK_PORT and ADM_HTTPS_PORT, so logins and token issuers match the ports in use. The services no longer set container_name, so Compose names containers, network, and images after the project directory (adm-oracle-1 and so on), and a copy in a git worktree gets its own. The integrationTest task passes the ADM_* variables in .env to the tests, which build their default URLs from ADM_HTTPS_PORT and ADM_KEYCLOAK_PORT. The README lists the variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
slominskir
approved these changes
Oct 1, 2026
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.
Builds on #24, and targets its branch so the diff shows only this change. When #24 is merged and its branch deleted, GitHub retargets this PR to
main.Problem
Two copies of the Compose stack, or adm and another project's containers, couldn't run at once on one machine:
adm-oracleand the others (oracle,keycloakandsshdindeps.yaml), so a second copy, such as a sister agent's worktree, collided even on other ports.What changed
.env:ADM_HTTPS_PORTADM_HTTP_PORTADM_MANAGEMENT_PORTADM_KEYCLOAK_PORTADM_KEYCLOAK_MANAGEMENT_PORTADM_ORACLE_PORTADM_ORACLE_EM_PORTADM_SSHD_PORTKC_FRONTEND_URLandKC_REDIRECT_URIS, and the app'sKEYCLOAK_FRONTEND_SERVER_URLandFRONTEND_SERVER_URL, useADM_KEYCLOAK_PORTandADM_HTTPS_PORT. Logins and token issuers therefore match the ports in use. The app's values were DockerfileENVs; Compose now sets them.container_name: Compose names containers, the network and built images after the project directory:adm-oracle-1,adm-adm-1and so on. A copy in another directory, such as a git worktree, gets its own. Commands likedocker exec -it adm-oracle ...need the new names. The devcontainer'sdev.yamlkeeps its own names.integrationTestpasses theADM_*variables from.envto the tests, with the environment taking precedence, and the tests build their default URLs fromADM_HTTPS_PORTandADM_KEYCLOAK_PORT..envfor a second copy.The demo data's
local-devenv still deploys tolocalhost:1234, for a Wildfly run outside Docker. The README notes this next toADM_SSHD_PORT.Checks
On the agent VM:
docker compose -f build.yaml configwith the README's example.envpublishes only the1xxxxports, and the URLs above use 18081 and 18443.~/admand a second copy in a worktree with that.env(projectadm-ports-check)../gradlew integrationTestran against both at the same time, and all 12 tests passed in each. Each app's log showed only its own deploy job.That simultaneous start exposed a bug in #24's tests: they didn't wait for Keycloak's setup. That's fixed on #24 (9d46791).
Not checked: the devcontainer, and Compose versions older than the VM's.
🤖 Generated with Claude Code