From b10ce52cb917a450393ed8361706e96ced46de70 Mon Sep 17 00:00:00 2001 From: meliurwen Date: Sat, 22 Aug 2020 01:21:56 +0200 Subject: [PATCH] Added restart env --- .env.example | 2 ++ docker-compose.yml | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 933f603..d349b30 100644 --- a/.env.example +++ b/.env.example @@ -15,6 +15,7 @@ DB_PASSWD=passwordhere GT_IMG= GT_TAG= GT_CONTAINER_NAME= +GT_RESTART= # Database # If using PostgreSQL is better to use SIGTERM to power off the container which @@ -26,5 +27,6 @@ GT_CONTAINER_NAME= DB_IMG= DB_TAG= DB_CONTAINER_NAME= +GT_RESTART= DB_STOP_SIG= DB_STOP_GRC=30s diff --git a/docker-compose.yml b/docker-compose.yml index 3c66498..b3f33a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,8 @@ version: "3.1" services: server: image: ${GT_IMG:-gitea/gitea}:${GT_TAG:-latest} - container_name: ${GT_CONTAINER_NAME} - restart: unless-stopped + container_name: ${GT_CONTAINER_NAME:gitea} + restart: ${GT_RESTART:-unless-stopped} networks: - default - gitea @@ -30,7 +30,7 @@ services: db: image: ${DB_IMG:-postgres}:${DB_TAG:-12.4} container_name: ${DB_CONTAINER_NAME:-gitea-db} - restart: unless-stopped + restart: ${DB_RESTART:-unless-stopped} stop_signal: ${DB_STOP_SIG:-SIGTERM} stop_grace_period: ${DB_STOP_GRC:-10s} environment: