-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdocker-compose.yml
42 lines (40 loc) · 1.84 KB
/
docker-compose.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
version: '3'
services:
traefik:
image: traefik:v2.2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./letsencrypt/:/letsencrypt/
command:
- "--providers.docker"
- "--entrypoints.web.address=:80"
- "--entrypoints.webwecure.address=:443"
- "--certificatesresolvers.default.acme.dnschallenge=true"
# See here for your dnschallenge provider: https://go-acme.github.io/lego/dns/
- "--certificatesresolvers.default.acme.dnschallenge.provider=joker"
- "--certificatesresolvers.default.acme.storage=/letsencrypt/acme.json"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.http.tls=true"
- "--entrypoints.websecure.http.tls.certResolver=letsencrypt"
# Creates a wildcard certificate, messages like 404 pages are returned encrypted by Treafik.
- "--entrypoints.websecure.http.tls.domains[0].main=example.com"
- "--entrypoints.websecure.http.tls.domains[0].sans=*.example.com"
ports:
- "80:80"
- "443:443"
environment:
# See here for your dns provider variables: https://go-acme.github.io/lego/dns/
- JOKER_API_MODE=SVC
- JOKER_USERNAME=${SECRET_DNS_JOKER_USERNAME} # e.g. use an .env file for this secret
- JOKER_PASSWORD=${SECRET_DNS_JOKER_PASSWORD} # e.g. use an .env file for this secret
whoami:
image: containous/whoami
labels:
traefik.enable: true
traefik.http.routers.whoami.entrypoints: websecure
traefik.http.routers.whoami.rule: Host(`whoami.example.com`)"