-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
62 lines (58 loc) · 1.34 KB
/
compose.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
services:
postgres:
image: postgres:14.5-alpine
ports:
- 5432:5432
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d postgres -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./docker/postgres:/var/lib/postgresql/data
restart: on-failure
django:
build:
context: .
dockerfile: dockerfile
command: sh -c "python manage.py migrate && python manage.py runserver"
ports:
- 8000:8000
environment:
DJANGO_DB_NAME: postgres
DJANGO_DB_USER: postgres
DJANGO_DB_PASSWORD: postgres
DJANGO_DB_HOST: postgres
DJANGO_DB_PORT: 5432
depends_on:
postgres:
condition: service_healthy
volumes:
- .:/backend
restart: on-failure
vite:
build:
context: frontend/
dockerfile: dockerfile
command: npm run dev
ports:
- 3000:3000
depends_on:
django:
condition: service_started
volumes:
- ./frontend:/frontend
- node_modules:/frontend/node_modules
restart: on-failure
nginx:
image: nginx:stable
network_mode: host
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
restart: on-failure
volumes:
node_modules: