-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
117 lines (109 loc) · 2.46 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
services:
mysqldb:
build: ./backend-django/db
container_name: mysqldb
env_file:
- "backend-django/db/.env"
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
networks:
- app-network
backend:
build:
context: ./backend-django/backend
dockerfile: Dockerfile
container_name: backend
ports:
- "8000:8000"
volumes:
- ./backend-django:/app
- ./backend-django/logs:/app/logs
restart: always
depends_on:
- mysqldb
- rabbitmq
- redis
networks:
- app-network
command: >
bash -c "python wait_mysql.py &&
python manage.py makemigrations &&
python manage.py migrate &&
gunicorn -w 4 -b 0.0.0.0:8000 backend.wsgi:application"
nginx:
build: ./nginx
container_name: nginx
ports:
- 80:80
- 443:443
restart: always
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf
- build_folder:/var/www/frontend
depends_on:
- backend
- frontend
networks:
- app-network
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
frontend:
build:
context: ./frontend/server
dockerfile: Dockerfile
container_name: frontend
ports:
- "3000:3000"
volumes:
- /frontend/server/node_modules
- build_folder:/frontend/dist
networks:
- app-network
rabbitmq:
image: "rabbitmq:3-management"
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
- "15692:15692"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
environment:
RABBITMQ_DEFAULT_USER: "guest"
RABBITMQ_DEFAULT_PASS: "guest"
networks:
- app-network
command: >
bash -c "rabbitmq-plugins enable rabbitmq_prometheus &&
rabbitmq-server"
redis:
image: redis
container_name: redis
ports:
- "6379:6379"
networks:
- app-network
celery:
build:
context: ./backend-django/backend
dockerfile: Dockerfile
container_name: celery
volumes:
- ./backend-django:/app
- ./backend-django/logs:/app/logs
restart: always
depends_on:
- backend
- rabbitmq
- redis
networks:
- app-network
command: ["celery", "-A", "backend", "worker", "--loglevel=info"]
volumes:
mysql_data:
rabbitmq_data:
build_folder: null
networks:
app-network:
driver: bridge