Repository navigation
Expand file tree
/
Copy pathdocker-compose.fullstack.yml
More file actions
84 lines (79 loc) · 2.57 KB
/
Copy pathdocker-compose.fullstack.yml
File metadata and controls
84 lines (79 loc) · 2.57 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
# Single-container self-hosting stack. Requires backend/.env — see docs/user-guide/01-getting-started.md ("Building from source").
# Publish nginx on loopback for a trusted local TLS proxy.
services:
app:
build:
context: .
dockerfile: Dockerfile.fullstack
args:
VITE_API_BASE_URL: /api/v1
env_file:
- backend/.env
environment:
DATABASE_URL: postgres://openzev:openzev@db:5432/openzev
CELERY_BROKER_URL: redis://valkey:6379/0
CACHE_URL: redis://valkey:6379/1
# Bundled nginx overwrites X-Forwarded-For.
NUM_PROXIES: 1
depends_on:
- db
- valkey
# Only a trusted local TLS proxy may reach this port.
ports:
- "127.0.0.1:8080:8080"
volumes:
- backend_media:/app/media
worker:
build:
context: .
dockerfile: backend/Dockerfile
command: celery -A config worker -l info
env_file:
- backend/.env
environment:
DATABASE_URL: postgres://openzev:openzev@db:5432/openzev
CELERY_BROKER_URL: redis://valkey:6379/0
CACHE_URL: redis://valkey:6379/1
volumes:
- backend_media:/app/media
depends_on:
- app
- valkey
beat:
build:
context: .
dockerfile: backend/Dockerfile
command: celery -A config beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
env_file:
- backend/.env
environment:
DATABASE_URL: postgres://openzev:openzev@db:5432/openzev
CELERY_BROKER_URL: redis://valkey:6379/0
CACHE_URL: redis://valkey:6379/1
depends_on:
- app
- valkey
# On a fresh stack, migrations run inside the app container's own
# startup command and this container can win the race and start before
# they land — django_celery_beat's scheduler tables won't exist yet and
# it exits. Unlike every other service here, that first failure is
# expected rather than a bug, so unlike them beat gets a restart policy.
restart: on-failure
db:
image: postgres:18-alpine
environment:
POSTGRES_DB: openzev
POSTGRES_USER: openzev
# Fixed password is deliberate — this port is never published.
POSTGRES_PASSWORD: openzev
# Keep in step with docker-compose.yml — see the note there.
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
# Same mount path as docker-compose.yml: the volume is shared, and a
# differing path silently gives this stack its own cluster (#492).
- postgres_data:/var/lib/postgresql/data
valkey:
image: valkey/valkey:9-alpine
volumes:
postgres_data:
backend_media: