Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (64 loc) · 2.12 KB
/
Copy pathdocker-compose.yml
File metadata and controls
66 lines (64 loc) · 2.12 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
services:
pgw:
build: .
image: pgw:latest
stdin_open: true
tty: true
ports:
- "8321:8321"
volumes:
- .:/data
# DOCKER DEV: mount host-built dist/ for instant frontend updates
# and set PGW_SPA_DIR=/spa in environment:
# - ./src/pgw/templates/dist:/spa
# Pick up secrets + admin bootstrap from .env (gitignored). Anything
# in ``environment:`` below wins over ``.env`` — keep operator vars
# there and per-deployment secrets in .env.
env_file:
- path: .env
required: false
environment:
- PGW_WORKSPACE_DIR=/data/pgw_workspace
- PGW_SERVE_HOST=0.0.0.0
- PGW_SERVE_MAX_JOBS=1
- PGW_DATABASE_URL=postgresql+psycopg://pgw:pgw@postgres:5432/pgw_dev
# PGW_SECRET_KEY, PGW_ADMIN_EMAIL, PGW_ADMIN_PASSWORD, and provider
# API keys (GROQ_API_KEY etc.) come from the .env file. Generate a
# strong secret with:
# python -c "import secrets; print(secrets.token_urlsafe(32))"
# Frontend dev override (mount dist/ and set PGW_SPA_DIR=/spa):
# - PGW_SPA_DIR=/spa
# Inherit ENTRYPOINT from the Dockerfile (`pgw-entrypoint`) so the
# container runs `pgw maintenance migrate` before serving.
command: ["serve", "--no-open"]
depends_on:
postgres:
condition: service_healthy
healthcheck:
# /healthz checks DB reachability + worker registry sanity. We use
# python instead of curl so the runtime image stays slim.
test:
- "CMD-SHELL"
- "python -c 'import urllib.request,sys; sys.exit(0 if urllib.request.urlopen(\"http://127.0.0.1:8321/healthz\", timeout=5).status==200 else 1)'"
interval: 15s
timeout: 8s
retries: 4
start_period: 30s
postgres:
image: postgres:16-alpine
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: pgw
POSTGRES_PASSWORD: pgw
POSTGRES_DB: pgw_dev
volumes:
- pgw_pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pgw -d pgw_dev"]
interval: 5s
timeout: 5s
retries: 10
volumes:
pgw_pg_data: