Skip to content

docs(docker): add compose environment example - #970

Open
RobinALG87 wants to merge 1 commit into
hapifhir:masterfrom
RobinALG87:docs/docker-compose-env-example
Open

docs(docker): add compose environment example#970
RobinALG87 wants to merge 1 commit into
hapifhir:masterfrom
RobinALG87:docs/docker-compose-env-example

Conversation

@RobinALG87

@RobinALG87 RobinALG87 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a small .env.example for Docker Compose users so they can customize the published port and PostgreSQL settings without editing docker-compose.yml.

Changes

  • Add .env.example with the current Docker Compose defaults.
  • Read Docker Compose port and PostgreSQL values from environment variables with the same fallback defaults.
  • Ignore local .env files and document the copy/edit workflow in the README.

Testing

  • Ran git diff --check upstream/master...origin/docs/docker-compose-env-example.
  • Ran docker compose config with default values.
  • Ran PowerShell override check with HAPI_FHIR_PORT=8888 plus custom POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, and POSTGRES_PORT, then ran docker compose config.

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 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.example containing the current Docker Compose default values.
  • Parameterize the JPA server port mapping and PostgreSQL connection settings via ${VAR:-default} interpolation in docker-compose.yml.
  • Update docs to describe the .env.example.env copy/edit workflow and ignore local .env files 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 thread docker-compose.yml
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"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants