From 8976b19a84360e352d77e389751dbc9ba9b918ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B3=E9=88=9E?= Date: Sat, 25 Jun 2022 19:14:23 +0800 Subject: [PATCH] Bug 20: Avoid repeated program restarts fix #20 --- docker-compose.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 685d1a9..d50aaf4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,9 @@ services: instagram-to-discord: image: ghcr.io/jim60105/docker-instagram-to-discord # build: . - restart: always + labels: + - 'instagram-to-discord' + restart: on-failure:3 volumes: - ./config.yml:/usr/src/app/config.yml:ro - db:/usr/src/app/db @@ -13,5 +15,18 @@ services: # options: # gelf-address: "udp://127.0.0.1:12201" + # Start container every day. (if it's not running) + jobber: + image: blacklabelops/jobber:docker + restart: always + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + environment: + - JOB_NAME1=start + - JOB_COMMAND1=docker start $$(docker ps -aqf "label=instagram-to-discord") + - JOB_TIME1=0 0 0 * * * #Every day + - JOB_NOTIFY_ERR1=false + - JOB_NOTIFY_FAIL1=false + volumes: db: