version: '2' service: caddy: image: lucaslorentz/caddy-docker-proxy ports: - 80:80 - 443:443 networks: - caddy volumes: - /var/run/docker.sock:/var/run/docker.sock # this volume is needed to keep the certificates # otherwise, new ones will be re-issued upon restart - caddy_data:/data labels: # Global options caddy.email: arne.schroeder@mailbox.org # Proxy to service whoami0: image: jwilder/whoami networks: - caddy labels: caddy: whoami0.devsrv.fritz.box caddy.reverse_proxy: "{{upstreams 8000}}" caddy.tls: "internal" # Proxy to service that you want to expose to the outside world whoami1: image: jwilder/whoami networks: - caddy labels: caddy: whoami1.devsrv.fritz.box caddy.reverse_proxy: "{{upstreams 8000}}" caddy.tls: "internal" # remove the following line when you have verified your setup # Otherwise you risk being rate limited by let's encrypt #caddy.tls.ca: https://acme-staging-v02.api.letsencrypt.org/directory # Proxy to container whoami2: image: jwilder/whoami networks: - caddy labels: caddy: whoami2.devsrv.fritz.box caddy.reverse_proxy: "{{upstreams 8000}}" caddy.tls: "internal" # Proxy to container whoami3: image: jwilder/whoami networks: - caddy labels: caddy: whoami3.devsrv.fritz.box caddy.reverse_proxy: "{{upstreams 8000}}" caddy.tls: "internal" # Proxy with matches and route echo_0: image: brndnmtthws/nginx-echo-headers networks: - caddy labels: caddy: echo0.devsrv.fritz.box caddy.@match.path: "/sourcepath /sourcepath/*" caddy.route: "@match" caddy.route.0_uri: "strip_prefix /sourcepath" caddy.route.1_rewrite: "* /targetpath{path}" caddy.route.2_reverse_proxy: "{{upstreams 8080}}" caddy.tls: "internal"