feat: interpolate name of user and database

Unless explicitely set, the database name is nevertheless derived from
the user by the image's entrypoint, but we can make this more obvious by
defining a interpolation here.
This commit is contained in:
Christoph Schug 2024-03-02 16:43:49 +01:00
parent ce2caf7c8f
commit 911fcc61eb

View File

@ -7,10 +7,9 @@ services:
environment: environment:
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS---data-checksums} - POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS---data-checksums}
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD-} - POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD-}
- POSTGRES_USER=${POSTGRES_USER} - POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
# (Optional) when creating a new database - POSTGRES_DB=${POSTGRES_DB:-$POSTGRES_USER}
# - POSTGRES_DB=${POSTGRES_DB}
- TZ=${TZ:-UTC} - TZ=${TZ:-UTC}
ports: ports:
- 5432:5432 - 5432:5432