Improve database configuration and volume management in Docker setup#153
Open
iam-deepaknagaraj wants to merge 1 commit intoopf:stable/17from
Open
Conversation
…uration and volume management
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.
Ticket
https://community.openproject.org/projects/docker/work_packages/73743/activity
What are you trying to accomplish?
Improve the Docker Compose developer/operator experience for the bundled
openproject-docker-composesetup by:openproject/proxyfrom a registry even though that image is only produced by the local./proxybuild, which led to pull errors (e.g. “pull access denied” / “repository does not exist”) ondocker compose updepending on Compose version and pull policy.POSTGRES_PASSWORDwithDATABASE_URL, and defaultDATABASE_URLindocker-compose.ymlto derive fromPOSTGRES_PASSWORDwhenDATABASE_URLis unset, so the app anddbservice stay in sync..env.example– Replace misleadingPGDATA/OPDATAvalues that looked like in-container paths but were interpreted as bind-mount sources (e.g./var/lib/postgresql/data), which reused existing clusters and caused persistent “password authentication failed for user postgres” when the password in.envdid not match the already-initialized database. The example now uses named volumes (pgdata,opdata) and short comments explaining the semantics.Screenshots
N/A (configuration and documentation only).
What approach did you choose and why?
pull_policy: buildonproxy– Tells Compose to build from./proxyand not pullopenproject/proxyfrom a registry. Minimal change; matches how the image is actually produced.DATABASE_URLdefault with${POSTGRES_PASSWORD}– Single source of truth for the default password when users omit an explicitDATABASE_URL, reducing drift betweendband app containers..env.examplewithPOSTGRES_PASSWORD,PGDATA=pgdata,OPDATA=opdata– Matches common Compose usage, avoids accidental bind mounts to host paths, and documents thatPOSTGRES_PASSWORDonly applies on first database initialization.Tradeoffs: Users who intentionally used bind mounts to host paths must set
PGDATA/OPDATAexplicitly to those paths; the sample no longer encodes that pattern.Alternatives considered: Renaming env vars (e.g.
POSTGRES_DATA_VOLUME) would be clearer but diverges further from upstream naming and existing docs; skipped for a smaller, reviewable change.Follow-up (optional, separate change): Align
README.mdsections that still assume/var/openproject/assetson the host with the new named-volume default in.env.example.