-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
159 lines (146 loc) · 3.11 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
version: '3.7'
services:
# application
web:
image: ghcr.io/nimaafshar/workload-generator-web:latest
pull_policy: always
depends_on:
- db
expose:
- "5000"
sysctls:
net.core.somaxconn: 30000
environment:
TZ: "America/Montreal"
WEB_WORKLOAD_CONFIG_MONGODB_USERNAME: root
WEB_WORKLOAD_CONFIG_MONGODB_PASSWORD: password
VIRTUAL_HOST: web.local
VIRTUAL_PORT: 5000
deploy:
resources:
limits:
cpus: 1.0
memory: 200M
logging:
driver: none
iot:
image: ghcr.io/nimaafshar/workload-generator-iot:latest
pull_policy: always
depends_on:
- web
- nginx-proxy
expose:
- "8000"
environment:
HOST_URL: http://web:5000/sensor/add
TZ: "America/Montreal"
IOT_LOG_LEVEL: 20 # info
volumes:
- ./config/iot/:/app/config/ # replace the config file
deploy:
resources:
limits:
memory: 100M
nginx-proxy:
image: nginxproxy/nginx-proxy
depends_on:
- web
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
deploy:
resources:
limits:
memory: 50M
db:
image: mongo:3-xenial
expose:
- "27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
volumes:
- ~/mongodata/:/data/db:rw
logging:
driver: none
deploy:
resources:
limits:
memory: 400M
# monitoring setup
cadvisor:
image: gcr.io/google-containers/cadvisor:latest
container_name: cadvisor
expose:
- "8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
depends_on:
- redis
deploy:
resources:
limits:
memory: 100M
redis:
image: redis:latest
container_name: redis
expose:
- "6379"
logging:
driver: none
deploy:
resources:
limits:
memory: 50M
prometheus:
image: prom/prometheus:latest
container_name: prometheus
expose:
- "9090"
command:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- cadvisor
deploy:
resources:
limits:
memory: 300M
nginx:
build: ./nginx
ports:
- "80:80"
- "9090:9090"
depends_on:
- grafana
- prometheus
deploy:
resources:
limits:
memory: 50M
grafana:
image: grafana/grafana:7.3.6
volumes:
- grafana_volume:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning/
- ./grafana/dashboards:/etc/grafana/dashboards
environment:
- "GF_SECURITY_ADMIN_USER=admin"
- "GF_SECURITY_ADMIN_PASSWORD=test12345"
expose:
- "3000"
depends_on:
- prometheus
deploy:
resources:
limits:
memory: 100M
volumes:
grafana_volume:
prometheus_data: