-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (44 loc) · 1.15 KB
/
Copy pathdocker-compose.yml
File metadata and controls
45 lines (44 loc) · 1.15 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
services:
zero:
image: python:3.12-slim
working_dir: /app
environment:
ZERO_ENV: production
ZERO_HOME: /data
ZERO_DATABASE_URL: sqlite:////data/zero.db
env_file:
- ./zero.env
volumes:
- ./:/app
- zero-data:/data
ports:
- "127.0.0.1:8000:8000"
command: >
sh -lc "pip install --no-cache-dir -e . &&
zero-develop migrate &&
uvicorn zero.main:app --host 0.0.0.0 --port 8000"
restart: unless-stopped
# Optional PostgreSQL backend (GAP 2). Start with:
# docker compose --profile pg up -d postgres
# then set ZERO_DATABASE_URL=postgresql://zero:zero@postgres:5432/zero
# and install the [pg] extra inside the zero service.
postgres:
image: postgres:16
profiles: ["pg"]
environment:
POSTGRES_USER: zero
POSTGRES_PASSWORD: zero
POSTGRES_DB: zero
volumes:
- pg-data:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U zero -d zero"]
interval: 5s
timeout: 3s
retries: 12
restart: unless-stopped
volumes:
zero-data:
pg-data: