feat: Adds watchtower to compose file, uses ci built image for caddy.
All checks were successful
CI / release (push) Successful in 1m47s

This commit is contained in:
2025-04-04 08:44:34 -04:00
parent 680d7fd15b
commit 01b662c4c2

View File

@@ -1,8 +1,6 @@
services: services:
caddy: caddy:
build: image: git.housh.dev/homelab/caddy:latest
context: .
dockerfile: Dockerfile
container_name: caddy container_name: caddy
restart: unless-stopped restart: unless-stopped
env_file: env_file:
@@ -18,13 +16,31 @@ services:
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
volumes: volumes:
- ./config:/etc/caddy:z
- caddy_data:/data - caddy_data:/data
- caddy_config:/config - caddy_config:/config
networks: networks:
- proxy - proxy
security_opt: security_opt:
- no-new-privileges:true - no-new-privileges:true
labels:
com.centurylinklabs.watchtower.enable: true
# This is primarily for pulling and restarting the primary caddy service
# because restarting caddy through webhooks spawned by komodo do not really
# work, because caddy is the gateway of communication with komodo, therefore
# when I tried webhooks it would pull the new data / configuration, stop the caddy service,
# and I would have to ssh into the server to restart caddy for changes to take effect.
watchtower:
image: containrrr/watchtower
container_name: watchtower
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- backend
environment:
WATCTOWER_LABEL_ENABLE: true
WATCHTOWER_POLL_INTERVAL: 300 # 5 minutes
volumes: volumes:
caddy_data: {} caddy_data: {}
@@ -33,3 +49,5 @@ volumes:
networks: networks:
proxy: proxy:
external: true external: true
backend:
external: true