-
Notifications
You must be signed in to change notification settings - Fork 19
/
docker-compose.traefik.yml
74 lines (69 loc) · 1.36 KB
/
docker-compose.traefik.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
version: '3.3'
networks:
proxy:
external:
name: proxy
configs:
traefik_toml_v2:
file: ./traefik.toml
nginx_conf:
file: ./nginx-redirect.conf
secrets:
traefik_cert:
file: ./tls/cert.pem
traefik_key:
file: ./tls/key.pem
services:
traefik:
image: traefik:1.4
deploy:
replicas: 2
placement:
constraints:
- node.role == manager
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- proxy
ports:
- target: 80
protocol: tcp
published: 80
mode: ingress
- target: 443
protocol: tcp
published: 443
mode: ingress
- target: 8080
protocol: tcp
published: 8080
mode: ingress
configs:
- source: traefik_toml_v2
target: /etc/traefik/traefik.toml
mode: 444
secrets:
- source: traefik_cert
target: cert.pem
uid: "0"
mode: 400
- source: traefik_key
target: key.pem
uid: "0"
mode: 400
nginx_redirect:
image: nginx:1.13
networks:
- proxy
deploy:
replicas: 2
labels:
- traefik.frontend.entryPoints=http
- traefik.frontend.rule=PathPrefix:/
- traefik.docker.network=proxy
- traefik.port=80
- traefik.enable=true
configs:
- source: nginx_conf
target: /etc/nginx/conf.d/default.conf
mode: 444