docs(docker): add compose environment example - #970
Open
RobinALG87 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Docker Compose developer experience by introducing an .env.example file and switching docker-compose.yml to use environment-variable overrides, so users can customize the published HTTP port and PostgreSQL settings without editing tracked YAML.
Changes:
- Add
.env.examplecontaining the current Docker Compose default values. - Parameterize the JPA server port mapping and PostgreSQL connection settings via
${VAR:-default}interpolation indocker-compose.yml. - Update docs to describe the
.env.example→.envcopy/edit workflow and ignore local.envfiles via.gitignore.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents the new .env.example workflow for overriding Compose defaults (port + PostgreSQL settings). |
| docker-compose.yml | Reads port and PostgreSQL config from environment variables with fallback defaults. |
| .gitignore | Ignores .env to avoid committing local Compose overrides. |
| .env.example | Provides a copyable baseline of the Compose defaults for user overrides. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+30
to
+34
| POSTGRES_DB: "${POSTGRES_DB:-hapi}" | ||
| POSTGRES_USER: "${POSTGRES_USER:-admin}" | ||
| POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-admin}" | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "sh -c 'pg_isready -U admin -d hapi' || exit 1"] | ||
| test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USER:-admin} -d ${POSTGRES_DB:-hapi}' || exit 1"] |
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.
Summary
Add a small
.env.examplefor Docker Compose users so they can customize the published port and PostgreSQL settings without editingdocker-compose.yml.Changes
.env.examplewith the current Docker Compose defaults..envfiles and document the copy/edit workflow in the README.Testing
git diff --check upstream/master...origin/docs/docker-compose-env-example.docker compose configwith default values.HAPI_FHIR_PORT=8888plus customPOSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_HOST, andPOSTGRES_PORT, then randocker compose config.