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}