[Fixes #14444] Use COMPOSE_ENV_FILE instead of ENVIRONMENT#14446
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the docker-compose.yml file to use ${COMPOSE_ENV_FILES:-.env} instead of .env${ENVIRONMENT:+_}${ENVIRONMENT:-} for specifying environment files across several services. While this simplifies environment file configuration, it introduces a limitation: COMPOSE_ENV_FILES is natively designed to support multiple comma-separated files, but using it inside the env_file list expects a single file path and will fail if multiple files are provided. It is recommended to document this limitation in the project's documentation to prevent user errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR addresses GeoNode issue #14444 by removing the custom ENVIRONMENT switch and aligning stack configuration with Docker Compose’s native env-file mechanism, so Compose project naming (and therefore container/volume names) and service env_file inputs stay consistent.
Changes:
- Replace
.env${ENVIRONMENT...}usage indocker-compose.ymlwith${COMPOSE_ENV_FILES:-.env}. - Update CI workflows to use
COMPOSE_ENV_FILES=.env_testinstead ofENVIRONMENT=test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
docker-compose.yml |
Switches service env_file selection to ${COMPOSE_ENV_FILES:-.env} for consistency with Compose project naming. |
.github/workflows/tests.yml |
Updates Docker Compose build step to use COMPOSE_ENV_FILES=.env_test. |
.github/workflows/run-test-suite.yml |
Updates stack lifecycle and test execution steps to use COMPOSE_ENV_FILES=.env_test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #14444
Replace the custom
ENVIRONMENTvariable with Compose's nativeCOMPOSE_ENV_FILES, which Compose itself uses to resolveCOMPOSE_PROJECT_NAME(and thus volume/container names) -- unlikeENVIRONMENT, which only affectedenv_file:and left project naming to always fall back to the default.env.COMPOSE_ENV_FILESisn't automatically injected into container environments, so each service'senv_file:now reads${COMPOSE_ENV_FILES:-.env}to keep naming and container config in sync from a single variable.Also updates
.github/workflows/tests.ymlandrun-test-suite.ymlto useCOMPOSE_ENV_FILES=.env_testinstead ofENVIRONMENT=test.Checklist
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.