forked from ALLBACK-2022/DoodleDoodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
203 lines (189 loc) · 4.02 KB
/
docker-compose.prod.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
version: "3"
services:
frontend:
build:
context: ./frontend
args:
- API_URL:"*"
container_name: frontend-con
volumes:
- build_frontend:/frontend/build
- ./frontend:/frontend/
- ./frontend/node_modules/:/frontend/node_modules
image: run
environment:
- WDS_SOCKET_PORT=0
- CI=true
- REACT_APP_BACKEND_URL=http://localhost:5000
- REACT_APP_AI_URL=http://localhost:5001
stdin_open: true
tty: true
backend:
build:
context: ./backend
ports:
- 5000:5000
environment:
FLASK_APP: ./app.py
APP_NAME: "backend"
STATSD_HOST: "statsd-exporter"
STATSD_PORT: "9125"
container_name: backend-con
env_file: ./backend/.env
restart: always
links:
- rabbitmq
- db
volumes:
- ./backend:/backend/
depends_on:
- db
- rabbitmq
networks:
- app-tier
tty: true
ai:
build:
context: ./ai
ports:
- 5001:5001
environment:
FLASK_APP: ./app.py
APP_NAME: "ai"
STATSD_HOST: "statsd-exporter"
STATSD_PORT: "9125"
env_file: ./ai/.env
container_name: ai-con
expose:
- 5001
restart: always
volumes:
- ./ai:/ai/
depends_on:
- rabbitmq
- db
- backend
links:
- rabbitmq
- db
networks:
- app-tier
tty: true
db:
image: mysql
container_name: mysql-con
ports:
- 3307:3306
volumes:
- data_mysql:/mysql
env_file:
- .env
networks:
- app-tier
tty: true
nginx:
build: ./nginx
ports:
- 80:80
volumes:
- build_frontend:/var/www/frontend
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
container_name: nginx-con
depends_on:
- frontend
- backend
- ai
networks:
- app-tier
tty: true
rabbitmq:
image : rabbitmq:3-management
container_name: rabbitmq-con
environment:
RABBITMQ_DEFAULT_USER: "${RABBITMQ_DEFAULT_USER}"
RABBITMQ_DEFAULT_PASS: "${RABBITMQ_DEFAULT_PASS}"
ports:
- 5672:5672
- 15672:15672
volumes:
- data_rabbitmq:/rabbitmq
networks:
- app-tier
tty: true
worker:
build:
context: './ai'
dockerfile: Dockerfile.celery
container_name: worker-con
user: nobody
command: celery -A ai.tasks.celery_app worker --loglevel=info
restart: always
volumes:
- ./ai:/ai/
depends_on:
- rabbitmq
- ai
- db
networks:
- app-tier
tty: true
flower:
image: mher/flower
container_name: flower-con
depends_on:
- rabbitmq
environment:
- CELERY_BROKER_URL=amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq:5672/
- FLOWER_PORT=5555
ports:
- 5555:5555
networks:
- app-tier
tty: true
statsd-exporter:
container_name: exporter-con
image: prom/statsd-exporter:v0.22.4
ports:
- "9125:9125"
- "9102:9102"
volumes:
- ./etc/statsd-exporter/statsd.conf:/statsd/statsd.conf
command:
- --statsd.mapping-config=/statsd/statsd.conf
networks:
- app-tier
prometheus:
container_name: prometheus-con
image: prom/prometheus:v2.33.5
ports:
- "9090:9090"
volumes:
- ./etc/prometheus:/workspace
command:
- '--config.file=/workspace/prometheus.yml'
networks:
- app-tier
grafana:
container_name: grafana-con
image: grafana/grafana:8.4.3
ports:
- "3000:3000"
volumes:
- ./etc/grafana/:/etc/grafana/provisioning/datasources
- ./etc/dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml
- ./etc/dashboards:/etc/grafana/dashboards
depends_on:
- prometheus
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
GF_AUTH_DISABLE_LOGIN_FORM: "true"
networks:
- app-tier
networks:
app-tier:
driver: bridge
volumes:
build_frontend: null
data_mysql: null
data_rabbitmq: null