-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathcompose.yml
More file actions
82 lines (76 loc) · 2.11 KB
/
Copy pathcompose.yml
File metadata and controls
82 lines (76 loc) · 2.11 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
x-common-settings: &common-settings
build:
context: .
dockerfile: Dockerfile
target: release
depends_on:
db:
condition: service_healthy
environment:
- "ALLOWED_HOSTS=*"
- "DATABASE_URL=postgres://postgres@db/postgres"
- "DJANGO_DEBUG=true"
# Keep the project venv OUT of /src so the host bind-mount below can't
# shadow it. Otherwise `uv run` rebuilds the venv on every invocation.
- "UV_PROJECT_ENVIRONMENT=/opt/venv"
env_file: .env
tty: true
volumes:
- .:/src:cache
- django-tailwind-cli-data:/src/.django_tailwind_cli
services:
db:
image: "pgautoupgrade/pgautoupgrade:17-alpine"
volumes:
- .:/src:cache
- postgres-data:/var/lib/postgresql/data/
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
healthcheck:
# CMD-SHELL takes a single command string; passing args as extra list
# items silently drops them. Use the full command as one string.
test: [ "CMD-SHELL", "pg_isready -U postgres -d postgres -q" ]
# `start_interval` (Docker 25+) lets us poll aggressively during boot
# and relax once the container is healthy.
interval: 30s
start_interval: 1s
start_period: 20s
timeout: 3s
retries: 5
user: postgres
init: true
tailwind:
command: [ "/src/start-tailwind.sh" ]
<<: *common-settings
init: true
utility:
command: [ "uv", "run", "--no-sync", "-m", "manage", "--version" ]
entrypoint: [ "/src/compose-entrypoint.sh" ]
<<: *common-settings
web:
ports:
- '8000:8000'
command: [ "/src/start-dev.sh" ]
healthcheck:
test: [ "CMD-SHELL", "/src/healthcheck-web.sh" ]
interval: 30s
start_interval: 2s
start_period: 60s
timeout: 5s
retries: 3
<<: *common-settings
init: true
worker:
command: [ "/src/start-worker.sh" ]
healthcheck:
test: [ "CMD-SHELL", "/src/healthcheck-worker.sh" ]
interval: 30s
start_interval: 3s
start_period: 60s
timeout: 10s
retries: 3
<<: *common-settings
init: true
volumes:
django-tailwind-cli-data:
postgres-data: