Skip to content

[Fixes #14444] Use COMPOSE_ENV_FILE instead of ENVIRONMENT#14446

Merged
etj merged 1 commit into
masterfrom
14444_env_file
Jul 17, 2026
Merged

[Fixes #14444] Use COMPOSE_ENV_FILE instead of ENVIRONMENT#14446
etj merged 1 commit into
masterfrom
14444_env_file

Conversation

@etj

@etj etj commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #14444

Replace the custom ENVIRONMENT variable with Compose's native COMPOSE_ENV_FILES, which Compose itself uses to resolve COMPOSE_PROJECT_NAME (and thus volume/container names) -- unlike ENVIRONMENT, which only affected env_file: and left project naming to always fall back to the default .env.

COMPOSE_ENV_FILES isn't automatically injected into container environments, so each service's env_file: now reads ${COMPOSE_ENV_FILES:-.env} to keep naming and container config in sync from a single variable.

Also updates .github/workflows/tests.yml and run-test-suite.yml to use COMPOSE_ENV_FILES=.env_test instead of ENVIRONMENT=test.

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.

The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):

  • There is a ticket in https://github.com/GeoNode/geonode/issues describing the issue/improvement/feature (a notable exemption is, changes not visible to end-users)
  • The issue connected to the PR must have Labels and Milestone assigned
  • PR for bug fixes and small new features are presented as a single commit
  • PR title must be in the form "[Fixes #<issue_number>] Title of the PR"
  • New unit tests have been added covering the changes, unless there is an explanation on why the tests are not necessary/implemented

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.

@etj
etj requested a review from mattiagiupponi July 16, 2026 15:59
@etj etj self-assigned this Jul 16, 2026
Copilot AI review requested due to automatic review settings July 16, 2026 15:59
@etj etj added the master label Jul 16, 2026
@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Jul 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docker-compose.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in docker-compose.yml with ${COMPOSE_ENV_FILES:-.env}.
  • Update CI workflows to use COMPOSE_ENV_FILES=.env_test instead of ENVIRONMENT=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.

Comment thread docker-compose.yml
Comment thread .github/workflows/run-test-suite.yml
@etj
etj merged commit f67cf8b into master Jul 17, 2026
18 checks passed
@etj
etj deleted the 14444_env_file branch July 17, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed CLA Bot: community license agreement signed master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use COMPOSE_ENV_FILE instead of ENVIRONMENT

3 participants