Added custom stop signal for database service

master
Meliurwen 4 years ago
parent 7ee0437b8b
commit 0bc2be311a
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 5
      .env.example
  2. 1
      docker-compose.yml

@ -17,6 +17,11 @@ GT_TAG=
GT_CONTAINER_NAME= GT_CONTAINER_NAME=
# Database # Database
# If using PostgreSQL is better to use SIGINT to power off the container which
# enables the "Fast Shutdown" mode.
# https://www.postgresql.org/docs/10/server-shutdown.html
# https://github.com/docker-library/postgres/issues/184#issuecomment-394822161
DB_IMG= DB_IMG=
DB_TAG= DB_TAG=
DB_CONTAINER_NAME= DB_CONTAINER_NAME=
DB_STOP_SIG=SIGINT

@ -31,6 +31,7 @@ services:
image: ${DB_IMG:-postgres}:${DB_TAG:-12.4} image: ${DB_IMG:-postgres}:${DB_TAG:-12.4}
container_name: ${DB_CONTAINER_NAME:-gitea-db} container_name: ${DB_CONTAINER_NAME:-gitea-db}
restart: unless-stopped restart: unless-stopped
stop_signal: ${DB_STOP_SIG:-SIGTERM}
environment: environment:
- POSTGRES_USER=${DB_USER} - POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWD} - POSTGRES_PASSWORD=${DB_PASSWD}

Loading…
Cancel
Save