From 0bc2be311a39c9f7726698b1cf642b95805cd30a Mon Sep 17 00:00:00 2001 From: meliurwen Date: Fri, 21 Aug 2020 00:25:13 +0200 Subject: [PATCH] Added custom stop signal for database service --- .env.example | 5 +++++ docker-compose.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/.env.example b/.env.example index c36769e..8987722 100644 --- a/.env.example +++ b/.env.example @@ -17,6 +17,11 @@ GT_TAG= GT_CONTAINER_NAME= # 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_TAG= DB_CONTAINER_NAME= +DB_STOP_SIG=SIGINT diff --git a/docker-compose.yml b/docker-compose.yml index 941a141..e596937 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,7 @@ services: image: ${DB_IMG:-postgres}:${DB_TAG:-12.4} container_name: ${DB_CONTAINER_NAME:-gitea-db} restart: unless-stopped + stop_signal: ${DB_STOP_SIG:-SIGTERM} environment: - POSTGRES_USER=${DB_USER} - POSTGRES_PASSWORD=${DB_PASSWD}