-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
175 lines (160 loc) · 3.81 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: "3.8"
volumes:
mysql_data:
elasticsearch_volume:
services:
mysqldb:
build: backend/db
env_file:
- "backend/db/db.env"
ports:
- "8989:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
timeout: 20s
retries: 10
backend:
build: ./backend/was
command: >
bash -c "python wait_mysql.py &&
python setup_es.py &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8080"
ports:
- "8080:8080"
volumes:
- ./backend/was:/app
depends_on:
mysqldb:
condition: service_healthy
elasticsearch:
condition: service_healthy
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./observe/prometheus/config/:/etc/prometheus/
ports:
- 9090:9090
command:
- '--web.enable-lifecycle'
- '--config.file=/etc/prometheus/prometheus.yml'
restart: always
grafana:
image: grafana/grafana
container_name: grafana
depends_on:
- prometheus
ports:
- 3100:3100
volumes:
- ./observe/grafana/grafana.ini:/etc/grafana/grafana.ini
restart: always
elasticsearch:
build:
context: backend/master_node/
args:
ELK_VERSION: 7.16.3
volumes:
- ./backend/master_node/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro,z
- elasticsearch_volume:/usr/share/elasticsearch/data:z
ports:
- "9200:9200"
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
healthcheck:
test: curl -u elastic:elastic -s -f elasticsearch:9200/_cat/health >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
node_1:
build:
context: backend/node_1/
args:
ELK_VERSION: 7.16.3
volumes:
- ./backend/node_1/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro,z
ports:
- "9201:9201"
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
healthcheck:
test: curl -u elastic:elastic -s -f elasticsearch:9200/_cat/health >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
depends_on:
elasticsearch:
condition: service_healthy
frontend:
build: ./frontend
command: ["npm", "start"]
ports:
- 3000:3000
volumes:
- ./frontend:/app
redis:
container_name: redis
image: redis:latest
hostname: redis
ports:
- "6379:6379"
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3-management-alpine
environment:
- RABBITMQ_USER=guest
- RABBITMQ_PASSWORD=guest
ports:
- "5672:5672" # Default Port
- "15672:15672" # For UI
expose:
- "15672"
celery_worker:
container_name: celery_worker
build:
context: ./backend/was
dockerfile: dockerfile
volumes:
- ./backend/was:/backend
ports: []
depends_on:
- rabbitmq
- redis
- backend
environment:
- C_FORCE_ROOT=true
command: sh -c "python wait_mysql.py &&
celery -A was worker --loglevel=info"
kibana:
container_name: kibana
image: kibana:7.16.3
ports:
- "5601:5601"
depends_on:
- elasticsearch
nginx:
build: backend/nginx
ports:
- 80:80
volumes:
- ./backend/nginx/nginx:/etc/nginx
depends_on:
- backend
# cadvisor:
# image: gcr.io/cadvisor/cadvisor:latest
# container_name: cadvisor
# ports:
# - 8090:8090
# volumes:
# - /:/rootfs:ro
# - /var/run:/var/run:rw
# - /sys:/sys:ro
# - /var/lib/docker/:/var/lib/docker:ro
# depends_on:
# - redis
# command:
# - '-port=8090'