-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yaml
123 lines (112 loc) · 2.64 KB
/
docker-compose.prod.yaml
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
version: "3.8"
volumes:
mysql_data:
redisdata:
build_folder:
grafana_data:
services:
mysqldb:
build: ./backend/db
env_file:
- "./backend/db/db.env"
ports:
- "3307:3306"
volumes:
- mysql_data:/var/lib/mysql
backend:
build: ./backend/backend
command: >
bash -c "python wait_mysql.py &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py loaddata fixture.json &&
gunicorn backend.wsgi:application --bind 0.0.0.0:8080" &&
ports:
- "8080:8080"
volumes:
- ./backend/backend:/app
depends_on:
- mysqldb
- redis
links:
- mysqldb
redis:
container_name: redis
image: redis:latest
hostname: redis
ports:
- "6379:6379"
volumes:
- 'redisdata:/data'
nginx:
build: ./nginx
ports:
- "80:80"
volumes:
- build_folder:/var/www/frontend
depends_on:
- backend
- client
client:
container_name: client
build:
context: ./frontend
dockerfile: Dockerfile
volumes:
- ./frontend/:/frontend
- build_folder:/frontend/build
tty: true
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/backend
dockerfile: dockerfile
volumes:
- ./backend/backend:/app
ports: []
depends_on:
- rabbitmq
- redis
- backend
environment:
- C_FORCE_ROOT=true
command: sh -c "python wait_mysql.py &&
celery -A backend worker --loglevel=info"
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./backend/prometheus/:/etc/prometheus/
ports:
- 9090:9090
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.console.templates=/etc/prometheus/consoles/'
- '--web.console.libraries=/etc/prometheus/console_libraries/'
restart: always
grafana:
image: grafana/grafana
environment:
GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource"
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
GF_AUTH_DISABLE_LOGIN_FORM: "true"
volumes:
- grafana_data:/var/lib/grafana
ports:
- 3001:3000
depends_on:
- prometheus
# network_mode: host
restart: always