From 18f99744c1abbf45509caefdfd3ff451da79e6fe Mon Sep 17 00:00:00 2001 From: Arul Agrawal Date: Tue, 1 Feb 2022 12:05:18 +0400 Subject: [PATCH] use watchtower scope --- configure-instance.sh | 0 template/docker-compose.caddy.yml | 23 +++++++++++++++++------ template/docker-compose.nginx.yml | 23 +++++++++++++++++------ 3 files changed, 34 insertions(+), 12 deletions(-) mode change 100755 => 100644 configure-instance.sh diff --git a/configure-instance.sh b/configure-instance.sh old mode 100755 new mode 100644 diff --git a/template/docker-compose.caddy.yml b/template/docker-compose.caddy.yml index 761eb49..c754974 100644 --- a/template/docker-compose.caddy.yml +++ b/template/docker-compose.caddy.yml @@ -5,15 +5,17 @@ services: depends_on: - piped container_name: piped-frontend - entrypoint: ash -c 'sed -i s/pipedapi.kavin.rocks/BACKEND_HOSTNAME/g - /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g - "daemon off;"' + entrypoint: ash -c 'sed -i s/pipedapi.kavin.rocks/BACKEND_HOSTNAME/g /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g "daemon off;"' + labels: + com.centurylinklabs.watchtower.scope: piped ytproxy: image: 1337kavin/ytproxy:latest restart: unless-stopped volumes: - ytproxy:/app/socket container_name: ytproxy + labels: + com.centurylinklabs.watchtower.scope: piped piped: image: 1337kavin/piped:latest restart: unless-stopped @@ -22,6 +24,8 @@ services: depends_on: - postgres container_name: piped-backend + labels: + com.centurylinklabs.watchtower.scope: piped varnish: image: varnish:7.0-alpine restart: unless-stopped @@ -31,11 +35,12 @@ services: depends_on: - piped healthcheck: - test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || - (varnishreload && exit 1)" + test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || (varnishreload && exit 1)" interval: 10s timeout: 10s retries: 1 + labels: + com.centurylinklabs.watchtower.scope: piped caddy: image: caddy:2-alpine restart: unless-stopped @@ -48,6 +53,8 @@ services: - caddy_data:/data - ytproxy:/var/run/ytproxy container_name: caddy + labels: + com.centurylinklabs.watchtower.scope: piped postgres: image: postgres:13-alpine restart: unless-stopped @@ -58,6 +65,8 @@ services: - POSTGRES_USER=piped - POSTGRES_PASSWORD=changeme container_name: postgres + labels: + com.centurylinklabs.watchtower.scope: piped watchtower: image: containrrr/watchtower restart: always @@ -68,7 +77,9 @@ services: - WATCHTOWER_CLEANUP=true - WATCHTOWER_INCLUDE_RESTARTING=true container_name: watchtower - command: piped-frontend piped-backend ytproxy varnish caddy postgres watchtower + command: --scope piped + labels: + com.centurylinklabs.watchtower.scope: piped volumes: caddy_data: null ytproxy: null diff --git a/template/docker-compose.nginx.yml b/template/docker-compose.nginx.yml index 1de3039..cdce90d 100644 --- a/template/docker-compose.nginx.yml +++ b/template/docker-compose.nginx.yml @@ -5,15 +5,17 @@ services: depends_on: - piped container_name: piped-frontend - entrypoint: ash -c 'sed -i s/pipedapi.kavin.rocks/BACKEND_HOSTNAME/g - /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g - "daemon off;"' + entrypoint: ash -c 'sed -i s/pipedapi.kavin.rocks/BACKEND_HOSTNAME/g /usr/share/nginx/html/assets/* && /docker-entrypoint.sh && nginx -g "daemon off;"' + labels: + com.centurylinklabs.watchtower.scope: piped ytproxy: image: 1337kavin/ytproxy:latest restart: unless-stopped volumes: - ytproxy:/app/socket container_name: ytproxy + labels: + com.centurylinklabs.watchtower.scope: piped piped: image: 1337kavin/piped:latest restart: unless-stopped @@ -22,6 +24,8 @@ services: depends_on: - postgres container_name: piped-backend + labels: + com.centurylinklabs.watchtower.scope: piped varnish: image: varnish:7.0-alpine restart: unless-stopped @@ -31,11 +35,12 @@ services: depends_on: - piped healthcheck: - test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || - (varnishreload && exit 1)" + test: ash -c "wget --no-verbose --tries=1 --spider 127.0.0.1:80/feed || (varnishreload && exit 1)" interval: 10s timeout: 10s retries: 1 + labels: + com.centurylinklabs.watchtower.scope: piped nginx: image: nginx:mainline-alpine restart: unless-stopped @@ -54,6 +59,8 @@ services: - varnish - ytproxy - pipedfrontend + labels: + com.centurylinklabs.watchtower.scope: piped postgres: image: postgres:13-alpine restart: unless-stopped @@ -64,6 +71,8 @@ services: - POSTGRES_USER=piped - POSTGRES_PASSWORD=changeme container_name: postgres + labels: + com.centurylinklabs.watchtower.scope: piped watchtower: image: containrrr/watchtower restart: always @@ -74,6 +83,8 @@ services: - WATCHTOWER_CLEANUP=true - WATCHTOWER_INCLUDE_RESTARTING=true container_name: watchtower - command: piped-frontend piped-backend ytproxy varnish nginx postgres watchtower + command: --scope piped + labels: + com.centurylinklabs.watchtower.scope: piped volumes: ytproxy: null