41 lines
1.6 KiB
YAML
41 lines
1.6 KiB
YAML
version: "3.8"
|
|
services:
|
|
traefik:
|
|
image: "traefik:latest"
|
|
container_name: "traefik"
|
|
command:
|
|
- "--api.dashboard=true"
|
|
- "--providers.docker=true"
|
|
- "--providers.docker.exposedbydefault=false"
|
|
- "--entrypoints.web.address=:80"
|
|
- "--entrypoints.websecure.address=:443"
|
|
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
|
|
- "--certificatesresolvers.myresolver.acme.email=contact@luke-else.co.uk"
|
|
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- "./letsencrypt:/letsencrypt"
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
networks:
|
|
- proxy
|
|
labels:
|
|
- "traefik.enable=true"
|
|
|
|
- "traefik.http.middlewares.redirect-web-secure.redirectscheme.scheme=https"
|
|
- "traefik.http.routers.traefik-insecure.middlewares=redirect-web-secure"
|
|
- "traefik.http.routers.traefik-insecure.rule=Host(`traefik.luke-else.co.uk`)"
|
|
- "traefik.http.routers.traefik-insecure.entrypoints=web"
|
|
|
|
- "traefik.http.routers.traefik.rule=Host(`traefik.luke-else.co.uk`)"
|
|
- "traefik.http.routers.traefik.entrypoints=websecure"
|
|
- "traefik.http.routers.traefik.service=api@internal"
|
|
- "traefik.http.routers.traefik.tls.certresolver=myresolver"
|
|
- "traefik.http.routers.traefik.middlewares=traefik-auth"
|
|
- "traefik.http.middlewares.traefik-auth.basicauth.users=user:$$2y$$05$$s/vPphFtSO2fWJR7SYkEb.90UwPDRM3aOKqgOF/rme/3fUQ5tvpTS"
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
proxy:
|
|
name: proxy |