-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathcompose.yaml
65 lines (60 loc) · 1.44 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
63
64
65
services:
client:
build:
context: .
target: build-node
command: npm run dev
volumes:
- .:/home/node/app
# node_modules is not shared with the host
- /home/node/app/node_modules
- client:/home/node/app/client/dist
db:
image: postgres:17-alpine
volumes:
- pgdata:/var/lib/postgresql/data/
- .data/db_dumps:/db_dumps
healthcheck:
test: pg_isready -U postgres -d {{ project_name }}
interval: 5s
timeout: 10s
retries: 120
environment:
- POSTGRES_DB={{ project_name }}
- POSTGRES_PASSWORD=postgres
app:
<<: &COMMON
build:
context: .
target: build-python
args:
UV_EXTRA_DEPENDENCIES: "dev"
environment:
- DEBUG=true
- DJANGO_ENV=development
- DATABASE_URL=postgres://postgres:postgres@db:5432/{{ project_name }}
- SECRET_KEY=not-secret
restart: on-failure
depends_on:
db:
condition: service_healthy
command: python manage.py runserver 0.0.0.0:8000
ports:
- ${PORT:-8000}:8000
stdin_open: true
tty: true
volumes:
- .:/app
- /app/.venv
- /app/{{ project_name }}.egg-info
- client:/app/client/dist
django-migrate:
<<: *COMMON
command: python manage.py migrate --noinput
volumes:
- .:/app
- /app/.venv
- /app/{{ project_name }}.egg-info
volumes:
client:
pgdata: