From ee41c1ce6450658e6d9ae22b22dc52711243520d Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Sat, 2 Aug 2025 22:23:19 +0200 Subject: [PATCH] fix: Deploy nginx using a stack file --- .github/workflows/deploy.yaml | 1 - docker/test/stack-config/nginx.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 docker/test/stack-config/nginx.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 5c3bbf3..a6bdfd1 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -127,7 +127,6 @@ jobs: key: ${{ secrets.DEPLOY_KEY }} script: | docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.env }} - docker service update --image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.env }} nginx-proxy for f in ~/stack-config/*.yaml; do NAME=$(basename "$f" .yaml) docker stack deploy -c "$f" "$NAME" diff --git a/docker/test/stack-config/nginx.yaml b/docker/test/stack-config/nginx.yaml new file mode 100644 index 0000000..8e32f7f --- /dev/null +++ b/docker/test/stack-config/nginx.yaml @@ -0,0 +1,29 @@ +services: + nginx-proxy: + image: ghcr.io/2martens/docker-nginx:test + deploy: + mode: global + ports: + - target: 80 + published: 80 + protocol: tcp + mode: host + - target: 443 + published: 443 + protocol: tcp + mode: host + volumes: + - type: bind + source: /etc/letsencrypt + target: /etc/letsencrypt + read_only: true + - type: bind + source: /var/www/certbot + target: /var/www/certbot + read_only: true + networks: + - internal_net + +networks: + internal_net: + external: true \ No newline at end of file