-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (79 loc) · 2.4 KB
/
Copy pathdocker-compose.yml
File metadata and controls
84 lines (79 loc) · 2.4 KB
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
81
82
83
84
version: '3'
services:
traefik:
image: traefik:v2.10
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--log.level=DEBUG"
- "--metrics.prometheus=true"
- "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0"
- "--accesslog=true"
- "--accesslog.filepath=/logs/access.log"
ports:
- "2000:80"
- "8081:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./logs:/logs
networks:
- web
todoapp1:
build: .
container_name: todoapp1
env_file: .env
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 3
labels:
- "traefik.enable=true"
- "traefik.http.routers.todoapp1.rule=Host(`192.168.1.102`)"
- "traefik.http.routers.todoapp1.entrypoints=web"
- "traefik.http.services.todoapp1.loadbalancer.server.port=3000"
- "traefik.http.middlewares.todoapp1-strip.stripprefix.prefixes=/"
- "traefik.http.routers.todoapp1.middlewares=todoapp1-strip"
networks:
- web
todoapp2:
build: .
container_name: todoapp2
env_file: .env
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 3
labels:
- "traefik.enable=true"
- "traefik.http.routers.todoapp2.rule=Host(`192.168.1.102`)"
- "traefik.http.routers.todoapp2.entrypoints=web"
- "traefik.http.services.todoapp2.loadbalancer.server.port=3000"
- "traefik.http.middlewares.todoapp2-strip.stripprefix.prefixes=/"
- "traefik.http.routers.todoapp2.middlewares=todoapp2-strip"
networks:
- web
todoapp3:
build: .
container_name: todoapp3
env_file: .env
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 3
labels:
- "traefik.enable=true"
- "traefik.http.routers.todoapp3.rule=Host(`192.168.1.102`)"
- "traefik.http.routers.todoapp3.entrypoints=web"
- "traefik.http.services.todoapp3.loadbalancer.server.port=3000"
- "traefik.http.middlewares.todoapp3-strip.stripprefix.prefixes=/"
- "traefik.http.routers.todoapp3.middlewares=todoapp3-strip"
networks:
- web
networks:
web:
driver: bridge