-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (82 loc) · 2.88 KB
/
Copy pathdocker-compose.yml
File metadata and controls
87 lines (82 loc) · 2.88 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
# Postil self-hosted stack: Postgres, web, worker.
#
# cp .env.example .env # fill in the required values
# # Download the postil-cli release matching POSTIL_CLI_REV below, verify
# # its checksum/signature, and place the binary at vendor/postil - the
# # Dockerfile bakes it in from there and does not fetch one itself.
# docker compose up -d
# docker compose exec web bun run db:migrate
#
# Both web and worker validate required configuration at boot and exit with
# an actionable message if anything is missing.
services:
db:
image: postgres:16
environment:
POSTGRES_USER: postil
POSTGRES_PASSWORD: postil
POSTGRES_DB: postil
volumes:
- postil-pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postil -d postil"]
interval: 5s
timeout: 3s
retries: 10
web:
build:
context: .
args:
# Records which postil-cli release the vendor/postil binary should
# match, for provenance/labels only - the build itself always uses
# whatever binary is at vendor/postil (see the header comment).
# Override alongside a new vendor/postil binary to upgrade the
# reviewer version.
POSTIL_CLI_REV: ${POSTIL_CLI_REV:-v0.7.2}
NEXT_PUBLIC_POSTHOG_HOST: ${NEXT_PUBLIC_POSTHOG_HOST:-https://eu.i.posthog.com}
env_file: .env
environment:
DATABASE_URL: postgres://postil:postil@db:5432/postil
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
healthcheck:
# Use the app runtime for the health probe to avoid an extra dependency.
test: ["CMD-SHELL", "bun -e 'const r=await fetch(\"http://localhost:3000/api/health\");if(!r.ok)process.exit(1)' || exit 1"]
interval: 15s
timeout: 5s
retries: 5
worker:
build:
context: .
args:
POSTIL_CLI_REV: ${POSTIL_CLI_REV:-v0.7.2}
NEXT_PUBLIC_POSTHOG_HOST: ${NEXT_PUBLIC_POSTHOG_HOST:-https://eu.i.posthog.com}
command: ["bun", "src/worker/index.ts"]
env_file: .env
environment:
DATABASE_URL: postgres://postil:postil@db:5432/postil
POSTIL_BIN: /usr/local/bin/postil
depends_on:
db:
condition: service_healthy
# Optional local model server. Not started by default; bring it up with
# docker compose --profile ollama up -d
# then pull a model before the first review:
# docker compose exec ollama ollama pull qwen3-coder:30b
# Set POSTIL_API_BASE=http://ollama:11434/v1 and
# POSTIL_ALLOW_PRIVATE_API_BASE=1 in .env so the worker can reach it on the
# compose network. Omit the profile and run Ollama on the host
# (POSTIL_API_BASE=http://host.docker.internal:11434/v1) if you prefer.
ollama:
image: ollama/ollama
profiles: ["ollama"]
volumes:
- postil-ollama:/root/.ollama
ports:
- "11434:11434"
volumes:
postil-pgdata:
postil-ollama: