-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
107 lines (99 loc) · 2.67 KB
/
docker-compose.yml
File metadata and controls
107 lines (99 loc) · 2.67 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
version: "3"
services:
traefik:
image: "traefik:v2.6"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
server-one:
image: scale-chat-server
build:
context: .
dockerfile: src/server/Dockerfile
environment:
ENABLE_DIST: "true"
DIST_SERVER: "redis:6379"
DIST_TOPIC: "messages"
deploy:
resources:
limits:
cpus: "0.25"
memory: 512M
reservations:
cpus: "0.25"
memory: 256M
depends_on:
- redis
labels:
- "traefik.enable=true"
- "traefik.http.routers.chat.service=chat"
- "traefik.http.routers.chat.rule=PathPrefix(`/`)"
- "traefik.http.services.chat.loadbalancer.sticky.cookie=true"
server-two:
image: scale-chat-server
build:
context: .
dockerfile: src/server/Dockerfile
environment:
ENABLE_DIST: "true"
DIST_SERVER: "redis:6379"
DIST_TOPIC: "messages"
deploy:
resources:
limits:
cpus: "0.25"
memory: 512M
reservations:
cpus: "0.25"
memory: 256M
depends_on:
- redis
labels:
- "traefik.enable=true"
- "traefik.http.routers.chat.service=chat"
- "traefik.http.routers.chat.rule=PathPrefix(`/`)"
- "traefik.http.services.chat.loadbalancer.sticky.cookie=true"
redis:
image: redis:6.2.6-alpine
ports:
- "6379:6379"
prometheus:
image: prom/prometheus:v2.31.1
user: 117:117
networks:
- default
depends_on:
- cadvisor
env_file:
- .env
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./prometheus/data:/prometheus
- /var/run/docker.sock:/var/run/docker.sock:ro
grafana:
image: grafana/grafana:8.2.5
environment:
PROMETHEUS_HOST: http://prometheus:9090
# When deploying with docker stack deploy the .env file will be ignored and the default config will be initialized
GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER}
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD}
ports:
- "3000:3000"
volumes:
- ./grafana/datasources:/etc/grafana/provisioning/datasources:ro
- ./grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
privileged: true