-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (99 loc) · 2.59 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (99 loc) · 2.59 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
x-app: &default-app
build:
context: "."
volumes:
- .:/app
restart: "unless-stopped"
# Rebuild the image automatically when dependency files change, instead of
# needing a manual --build.
x-default-watch: &default-watch
watch:
- action: rebuild
path: ./pyproject.toml
- action: rebuild
path: ./uv.lock
services:
django:
<<: *default-app
command: "uv run python manage.py runserver 0.0.0.0:8000"
ports:
- "8000:8000"
expose:
- "8000"
depends_on:
db:
condition: service_healthy
env_file:
# Later files win, so .env overrides .env.docker for local overrides.
- ./.env.docker
- ./.env
develop:
<<: *default-watch
worker:
<<: *default-app
command: "uv run python manage.py db_worker --interval 5"
depends_on:
- db
env_file:
# Later files win, so .env overrides .env.docker for local overrides.
- ./.env.docker
- ./.env
develop:
<<: *default-watch
scheduler:
<<: *default-app
command: "uv run python manage.py crontask --no-heartbeat"
depends_on:
- db
env_file:
# Later files win, so .env overrides .env.docker for local overrides.
- ./.env.docker
- ./.env
develop:
<<: *default-watch
tailwind:
<<: *default-app
command: "uv run python manage.py tailwind start"
# Without tty, no stdin, and tailwind watcher aborts
# https://github.com/tailwindlabs/tailwindcss/issues/5324
tty: true
volumes:
# The bind mount hides the node_modules baked into the image, so
# overlay it with a named volume seeded from the image's copy.
- .:/app
- tailwind:/app/theme/static_src/node_modules
env_file:
# Later files win, so .env overrides .env.docker for local overrides.
- ./.env.docker
- ./.env
develop:
watch:
- action: rebuild
path: ./pyproject.toml
- action: rebuild
path: ./uv.lock
- action: rebuild
path: ./theme/static_src/package.json
- action: rebuild
path: ./theme/static_src/package-lock.json
db:
restart: always
image: postgis/postgis:17-3.5
platform: linux/amd64
volumes:
- postgres_data:/var/lib/postgresql/data
env_file:
# Later files win, so .env overrides .env.docker for local overrides.
- ./.env.docker
- ./.env
ports:
- "5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 10
volumes:
postgres_data:
django:
tailwind: