-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
57 lines (53 loc) · 1.74 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: '3'
services:
traefik:
restart: unless-stopped
image: traefik:v2.10.5
ports:
- "80:80"
- "443:443"
labels:
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
- "traefik.http.routers.traefik.rule=Host(`traefik.traefik.me`)"
- "traefik.http.routers.traefik-tls.tls.domains[0].main=traefik.traefik.me"
- "traefik.http.routers.traefik-tls.tls.domains[0].sans=traefik-*.traefik.me"
volumes:
- ./traefik.yml:/etc/traefik/traefik.yml
- ./tls.yml:/etc/traefik/tls.yml
- /var/run/docker.sock:/var/run/docker.sock
- certs:/etc/ssl/traefik
networks:
- traefik
app1:
image: traefik/whoami
labels:
# - "traefik.http.routers.<UNIQUE ROUTER NAME, hint: user service name>.rule=Host(`app1.traefik.me`)"
- "traefik.http.routers.app1.rule=Host(`app1.traefik.me`)"
- "traefik.http.routers.app1-tls.tls.domains[0].main=app1.traefik.me"
- "traefik.http.routers.app1-tls.tls.domains[0].sans=app1-*.traefik.me"
networks:
- traefik
app2:
image: traefik/whoami
labels:
- "traefik.http.routers.app2.rule=Host(`app2.traefik.me`)"
- "traefik.http.routers.app2-tls.tls.domains[0].main=app2.traefik.me"
- "traefik.http.routers.app2-tls.tls.domains[0].sans=app2-*.traefik.me"
networks:
- traefik
reverse-proxy-https-helper:
image: alpine
command: sh -c "cd /etc/ssl/traefik
&& wget traefik.me/cert.pem -O cert.pem
&& wget traefik.me/privkey.pem -O privkey.pem"
volumes:
- certs:/etc/ssl/traefik
profiles:
- donotstart
volumes:
certs:
# define external (shared) network so other container sets may connnect.
networks:
traefik:
external: false
name: traefik