selfhost/www/docker-compose.yaml
2023-01-12 10:10:34 +01:00

29 lines
1.2 KiB
YAML

services:
app:
image: nginx
volumes:
- ${HTML}:/usr/share/nginx/html:ro
networks:
- web
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.webroot.entrypoints=websecure" # All HTTP requests are globally redirected to HTTPS
- "traefik.http.routers.webroot.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.webroot.tls.certresolver=netcup"
- "traefik.http.routers.webroot.tls.options=intermediate@file"
- "traefik.http.routers.webroot.middlewares=redirect-to-www"
- "traefik.http.middlewares.redirect-to-www.redirectregex.regex=^https?://florianzirker.de/(.*)"
- "traefik.http.middlewares.redirect-to-www.redirectregex.replacement=https://www.florianzirker.de/$${1}"
- "traefik.http.middlewares.redirect-to-www.redirectregex.permanent=true"
- "traefik.http.routers.www-secure.entrypoints=websecure"
- "traefik.http.routers.www-secure.rule=Host(`www.${DOMAIN}`)"
- "traefik.http.routers.www-secure.tls.certresolver=netcup"
- "traefik.http.routers.www-secure.tls.options=intermediate@file"
- "docker.group=www"
networks:
web:
external: true