From c81273a6df69cc798494c7f7fe722d5d3128ccc0 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Fri, 26 May 2023 12:39:11 +0600 Subject: [PATCH 1/5] add label to auto update nginx image with watchtower --- docker-compose.prod.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 9730f5b23..afa68ae3f 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -14,7 +14,7 @@ services: build: context: . dockerfile: Dockerfile - logging: + logging: driver: syslog options: tag: docker-${ENVIRONMENT_NAME}-spot-app @@ -37,7 +37,7 @@ services: spot-nginx: image: nginx:1.23 restart: always - logging: + logging: driver: syslog options: tag: docker-${ENVIRONMENT_NAME}-spot-nginx @@ -45,9 +45,11 @@ services: - ${INTERNAL_NETWORK_NAME} volumes: - ./etc/nginx/conf.d/spot.conf:/etc/nginx/conf.d/default.conf - - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf + - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf - ./etc/nginx/proxy_spot_params:/etc/nginx/proxy_spot_params - ./searx/static:/var/www/spot/static + labels: + - "com.centurylinklabs.watchtower.scope=uptime_kuma" filtron: image: dalf/filtron:latest -- GitLab From 7b1a50e928d2a5ff00fc6ec4a8aeb0f41ca11845 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Mon, 29 May 2023 12:35:33 +0600 Subject: [PATCH 2/5] add COMPOSE_PROJECT_NAME var --- .env | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 125455dd4..e96c5b7e3 100644 --- a/.env +++ b/.env @@ -1,3 +1,5 @@ +COMPOSE_PROJECT_NAME=staging + SPOT_HOSTNAME=spot.ecloud.global SPOT_DOCKER_TAG=latest SEARX_MORTY_URL=https://localhost:8089 @@ -8,4 +10,4 @@ SEARX_PROXY_HTTP=socks5h://tor-socks-proxy:9150 SEARX_PROXY_HTTPS=socks5h://tor-socks-proxy:9150 FILTRON_PORT=8088 NODE_NAME=local -CI_REGISTRY_IMAGE=registry.gitlab.e.foundation/e/infra/spot \ No newline at end of file +CI_REGISTRY_IMAGE=registry.gitlab.e.foundation/e/infra/spot -- GitLab From d47067c4231091187350df8ac79d166a886ed582 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Mon, 29 May 2023 12:36:06 +0600 Subject: [PATCH 3/5] add and use watchtower to update spot-nginx --- docker-compose.prod.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index afa68ae3f..d078855ea 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -49,7 +49,7 @@ services: - ./etc/nginx/proxy_spot_params:/etc/nginx/proxy_spot_params - ./searx/static:/var/www/spot/static labels: - - "com.centurylinklabs.watchtower.scope=uptime_kuma" + - "com.centurylinklabs.watchtower.scope=$COMPOSE_PROJECT_NAME" filtron: image: dalf/filtron:latest @@ -63,6 +63,13 @@ services: volumes: - ./etc/filtron/rules.json:/etc/filtron/rules.json + watchtower: + image: containrrr/watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: --interval 86400 --scope $COMPOSE_PROJECT_NAME + labels: + - "com.centurylinklabs.watchtower.scope=$COMPOSE_PROJECT_NAME" networks: staging-spot-default: -- GitLab From bd9e59692c0ab5bdec49b6fd1a9073a2e75b9074 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Mon, 29 May 2023 18:53:43 +0600 Subject: [PATCH 4/5] remove COMPOSE_PROJECT_NAME --- .env | 2 -- 1 file changed, 2 deletions(-) diff --git a/.env b/.env index e96c5b7e3..f7eba7e87 100644 --- a/.env +++ b/.env @@ -1,5 +1,3 @@ -COMPOSE_PROJECT_NAME=staging - SPOT_HOSTNAME=spot.ecloud.global SPOT_DOCKER_TAG=latest SEARX_MORTY_URL=https://localhost:8089 -- GitLab From baf31d262af2519bdae9d747bcd354270758f440 Mon Sep 17 00:00:00 2001 From: Fazle Rabbi Date: Mon, 29 May 2023 18:54:32 +0600 Subject: [PATCH 5/5] use scope staging-spot --- docker-compose.prod.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index d078855ea..325f0229b 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -49,7 +49,7 @@ services: - ./etc/nginx/proxy_spot_params:/etc/nginx/proxy_spot_params - ./searx/static:/var/www/spot/static labels: - - "com.centurylinklabs.watchtower.scope=$COMPOSE_PROJECT_NAME" + - "com.centurylinklabs.watchtower.scope=staging-spot" filtron: image: dalf/filtron:latest @@ -67,9 +67,9 @@ services: image: containrrr/watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock - command: --interval 86400 --scope $COMPOSE_PROJECT_NAME + command: --interval 86400 --scope staging-spot labels: - - "com.centurylinklabs.watchtower.scope=$COMPOSE_PROJECT_NAME" + - "com.centurylinklabs.watchtower.scope=staging-spot" networks: staging-spot-default: -- GitLab