Add caddy reverse proxy role

Acts as reverse proxy for the docker instance. Can be configured through
docker labels. Proxies anything that is received on port 80 or 443.
This commit is contained in:
Marty Oehme 2025-07-14 10:01:19 +02:00
parent ec91e97fed
commit e6b6154043
Signed by: Marty
GPG key ID: 4E535BC19C61886E
3 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,30 @@
services:
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
ports:
- 80:80
- 443:443
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- caddy_data:/caddy
labels:
caddy.auto_https: "off"
whoami:
container_name: whoami
image: traefik/whoami
networks:
- caddy
labels:
caddy: "http://test.pichi.berlin"
caddy.reverse_proxy: "{{ '{{' }}upstreams 80{{ '}}'}}" # has to be done to prevent ansible templating
networks:
caddy:
external: true
volumes:
caddy_data: {}