-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
63 lines (63 loc) · 1.37 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
services:
db:
image: mysql:8.0
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: mydatabase
MYSQL_USER: user
MYSQL_PASSWORD: password
container_name: db
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
ports:
- "8000:8000"
# volumes:
# - ./backend:/home/app/backend
container_name: backend
command: >
sh -c "
./wait-for-it.sh db:3306 --
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py loaddata ./core/fixtures/*.json &&
python manage.py runserver 0.0.0.0:8000"
restart: "on-failure"
env_file: ./backend/.env
depends_on:
db:
condition: service_healthy
client:
build:
context: ./client
ports:
- "3310:3310"
# volumes:
# - ./client:/home/app/client
container_name: client
command: >
sh -c "serve -s dist -l 3310"
restart: "on-failure"
env_file: ./client/.env
depends_on:
- backend
nginx:
image: nginx:1.27-alpine
volumes:
- ./nginx:/etc/nginx/conf.d
ports:
- "80:80"
depends_on:
- client
volumes:
db_data: