-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
58 lines (52 loc) · 1.29 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
# version is deprecated after docker 25.X
# version: '3.7'
services:
db:
image: mysql:8.0
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: mydatabase
MYSQL_USER: user
MYSQL_PASSWORD: password
backend:
build:
context: ./backend
ports:
- "8000:8000"
volumes:
- ./backend:/home/app/backend
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
env_file: ./backend/.env
restart: "on-failure"
depends_on:
- db
web:
build:
context: ./web
ports:
- "5173:5173"
volumes:
- ./web:/home/app/web
command: >
sh -c "npm install &&
npm run build &&
serve -s dist -l 5173"
restart: "on-failure"
depends_on:
- backend
nginx:
image: nginx:1.25.5-alpine
volumes:
- ./nginx:/etc/nginx/conf.d
ports:
- "80:80"
depends_on:
- web
volumes:
db_data: