/
docker-compose.yml
60 lines (55 loc) · 1.1 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
version: "3.7"
services:
# База данных
db:
image: mysql:5.7
ports:
- "3306:3306"
env_file: .env
restart: always
command:
[
"mysqld",
"--character-set-server=utf8mb4",
"--collation-server=utf8mb4_general_ci"
]
volumes:
- db_mysql:/var/lib/mysql
# Бэкенд Django
backend:
build:
context: ./backend
depends_on:
- db
volumes:
- ./backend:/app
command: /start.sh
entrypoint: /entrypoint.sh
restart: on-failure
env_file: .env
# Сборка фронтенда
frontend:
image: node:10-alpine
command: npm run serve
volumes:
- ./.env:/app/.env:ro
- ./frontend:/app
working_dir: /app
restart: on-failure
# Веб-сервер
nginx:
image: nginx:alpine
ports:
- "8003:80"
depends_on:
- db
- frontend
- backend
volumes:
- ./backend/media/:/media/
- ./backend/staticfiles/:/staticfiles/
- ./nginx/dev.conf:/etc/nginx/nginx.conf:ro
# logging:
# driver: none
volumes:
db_mysql: {}