Skip to content

Parameterize postgres db and user#143

Draft
WaleedMortaja wants to merge 2 commits intoopf:stable/17from
WaleedMortaja:parameterize-postgres-db-and-user
Draft

Parameterize postgres db and user#143
WaleedMortaja wants to merge 2 commits intoopf:stable/17from
WaleedMortaja:parameterize-postgres-db-and-user

Conversation

@WaleedMortaja
Copy link

Ticket

https://github.com/opf/openproject-docker-compose

What are you trying to accomplish?

Continue the work made in #142: Creating more parameters in environment variables.

What approach did you choose and why?

The same approach, but I am not sure if you would prefer to allow this flexibility or not, so I made it as a separate PR.

IMPORTANT NOTE: There are documentations that will need to be changed if this gets merged, because the values for db or username are hard-coded there. An example that I faced, but not necessary the only one, is migration-to-postgresql17
I would suggest editing the commands to be like:

source .env
docker compose exec -it -u postgres db pg_dump -d ${POSTGRES_DB:-openproject} -U ${POSTGRES_USER:-postgres} -x -O > openproject.sql

Or assume the variables are always set?

source .env
docker compose exec -it -u postgres db pg_dump -d ${POSTGRES_DB} -U ${POSTGRES_USER} -x -O > openproject.sql

Side note: The quotation for DATABASE_URL makes source execute without misinterpretation (Otherwise, & in the URL creates a background job)

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments