-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdocker-compose.prod.yml
51 lines (47 loc) · 1.72 KB
/
docker-compose.prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
version: "3.7"
networks:
web:
external: true
services:
traefik:
image: traefik:v2.3
restart: always
networks:
- web
ports:
- "80:80"
- "443:443"
# Uncomment for debug
#- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./letsencrypt:/letsencrypt
- ./traefik.auth:/auth/traefik.auth
command:
- --api.dashboard=true
# Uncomment for debug
#- --api.insecure=true
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --certificatesresolvers.leresolver.acme.httpchallenge.entrypoint=http
- --certificatesresolvers.leresolver.acme.storage=/letsencrypt/acme.json
- --certificatesresolvers.leresolver.acme.email=${LETS_ENCRYPT_EMAIL}
labels:
## TRAEFIK ROUTER & DASHBOARD
- traefik.enable=true
- traefik.http.routers.traefik.entrypoints=https
- traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DASHBOARD_HOST}`)
- traefik.http.routers.traefik.service=api@internal
- traefik.http.routers.traefik.middlewares=auth
- traefik.http.routers.traefik.tls.certresolver=leresolver
- traefik.http.services.traefik.loadbalancer.server.port=8080
## Global redirect to HTTPS
- traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)
- traefik.http.routers.http-catchall.entrypoints=http
- traefik.http.routers.http-catchall.middlewares=redirect-to-https
## Middlewares
- traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
## AUTH
- traefik.http.middlewares.auth.basicauth.usersfile=/auth/traefik.auth