head-vps/caddy/compose.yaml

30 lines
1,012 B
YAML

services:
caddy:
# Reads `caddy.*` labels from containers on the `caddy` network and serves them with automatic HTTPS.
image: lucaslorentz/caddy-docker-proxy:2.13.1-alpine@sha256:3e6cf4a6382da0cd14108a69929d7f8cc59e9a59cae4c9795071fa392ffa8036
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
environment:
CADDY_INGRESS_NETWORKS: caddy
labels:
caddy.email: ${ACME_EMAIL}
caddy.cert_issuer: ${CERT_ISSUER}
# Let's Encrypt staging, Caddy's default "test CA" for retries, is unreachable from this host
# (production is fine): without this, one failed attempt stalls every later one on staging.
caddy.cert_issuer.test_dir: https://acme-v02.api.letsencrypt.org/directory
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- data:/data
networks:
caddy:
# Created by bootstrap.sh and shared by every stack that serves a site.
external: true
volumes:
data: