Define database name (#343)

Set the database name to the default of the Zammad image to avoid an unused database with the name of the POSTGRES_USER var.

See default database name:
163377fc65/contrib/docker/docker-entrypoint.sh (L20)

See PostgreSQL image documentation:
https://hub.docker.com/_/postgres

POSTGRES_DB
This optional environment variable can be used to define a different name for the default database
that is created when the image is first started. If it is not specified, then the value of POSTGRES_USER will be used.
This commit is contained in:
Jan Kiesewetter 2023-06-14 11:36:01 +02:00 committed by GitHub
parent 1c52589095
commit 9a547c67a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

1
.env
View File

@ -3,6 +3,7 @@ MEMCACHE_SERVERS=zammad-memcached:11211
POSTGRES_VERSION=15.1-alpine POSTGRES_VERSION=15.1-alpine
POSTGRES_PASS=zammad POSTGRES_PASS=zammad
POSTGRES_USER=zammad POSTGRES_USER=zammad
POSTGRES_DB=zammad_production
REDIS_URL=redis://zammad-redis:6379 REDIS_URL=redis://zammad-redis:6379
RESTART=always RESTART=always
VERSION=5.4.1-29 VERSION=5.4.1-29

View File

@ -14,6 +14,7 @@ services:
- HOLD_DAYS=10 - HOLD_DAYS=10
- POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_USER=${POSTGRES_USER}
- POSTGRESQL_PASSWORD=${POSTGRES_PASS} - POSTGRESQL_PASSWORD=${POSTGRES_PASS}
- POSTGRESQL_DB=${POSTGRES_DB}
- TZ=Europe/Berlin - TZ=Europe/Berlin
image: postgres:${POSTGRES_VERSION} image: postgres:${POSTGRES_VERSION}
restart: ${RESTART} restart: ${RESTART}
@ -36,6 +37,7 @@ services:
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS} - MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
- POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_USER=${POSTGRES_USER}
- POSTGRESQL_PASS=${POSTGRES_PASS} - POSTGRESQL_PASS=${POSTGRES_PASS}
- POSTGRESQL_DB=${POSTGRES_DB}
- REDIS_URL=${REDIS_URL} - REDIS_URL=${REDIS_URL}
image: ${IMAGE_REPO}:${VERSION} image: ${IMAGE_REPO}:${VERSION}
restart: on-failure restart: on-failure
@ -62,6 +64,7 @@ services:
environment: environment:
- POSTGRES_USER=${POSTGRES_USER} - POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASS} - POSTGRES_PASSWORD=${POSTGRES_PASS}
- POSTGRES_DB=${POSTGRES_DB}
image: postgres:${POSTGRES_VERSION} image: postgres:${POSTGRES_VERSION}
restart: ${RESTART} restart: ${RESTART}
volumes: volumes: