-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-traefik-v3.yml
80 lines (76 loc) · 1.93 KB
/
docker-compose-traefik-v3.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
version: "3.3"
services:
######################################## Traefik ########################################
traefik:
image: traefik:${TRAEFIK_VERSION}
container_name: "traefik"
configs:
- source: traefik-conf
target: /etc/traefik/traefik.yml
- source: traefik-dyn
target: /etc/traefik/dyn.yml
networks:
- traefik-net
secrets:
- traefik-ssl-key
- traefik-ssl-crt
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.hackinglab.local`)"
- "traefik.http.routers.api.rule=PathPrefix(`/api`) || PathPrefix(`/dashboard`)"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.tls=true"
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
deploy:
resources:
limits:
cpus: '1'
memory: 300M
reservations:
cpus: '0.25'
memory: 20M
restart_policy:
condition: on-failure
delay: 5s
window: 120s
######################################## whomai ########################################
whoami:
image: "containous/whoami"
container_name: "traefik-whoami"
restart: unless-stopped
networks:
- traefik-net
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`whoami.hackinglab.local`)"
- "traefik.http.routers.whoami.tls=true"
deploy:
resources:
limits:
cpus: '0.5'
memory: 20M
reservations:
cpus: '0.1'
memory: 10M
restart_policy:
condition: on-failure
delay: 5s
window: 120s
configs:
traefik-conf:
external: true
traefik-dyn:
external: true
networks:
traefik-net:
driver: overlay
attachable: true
secrets:
traefik-ssl-key:
external: true
traefik-ssl-crt:
external: true