VHostLoom/sites/static-site/docker-compose.yml

32 lines
959 B
YAML

version: "3.9"
networks:
traefik_proxy:
external: true
services:
static_site:
image: nginx:alpine
container_name: static_site
restart: unless-stopped
networks:
- traefik_proxy
volumes:
- ./html:/usr/share/nginx/html:ro
labels:
- "traefik.enable=true"
# HTTP -> HTTPS
- "traefik.http.routers.static-http.rule=Host(`example.com`)"
- "traefik.http.routers.static-http.entrypoints=web"
- "traefik.http.routers.static-http.middlewares=static-https-redirect"
- "traefik.http.middlewares.static-https-redirect.redirectscheme.scheme=https"
# HTTPS
- "traefik.http.routers.static-https.rule=Host(`example.com`)"
- "traefik.http.routers.static-https.entrypoints=websecure"
- "traefik.http.routers.static-https.tls.certresolver=letsencrypt"
# Uncomment to protect with Authelia
# - "traefik.http.routers.static-https.middlewares=authelia-auth@file"