Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
131 lines (125 loc) · 4.35 KB
/
Copy pathdocker-compose.yml
File metadata and controls
131 lines (125 loc) · 4.35 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
services:
postgres:
image: postgres:15-alpine
container_name: unbound_postgres
environment:
POSTGRES_USER: unbound_user
POSTGRES_PASSWORD: unbound_password
POSTGRES_DB: unbound_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U unbound_user -d unbound_db"]
interval: 5s
timeout: 5s
retries: 5
storage:
image: rustfs/rustfs:latest
container_name: unbound_storage
ports:
- "9000:9000"
- "9001:9001"
environment:
RUSTFS_VOLUMES: '/data'
RUSTFS_ADDRESS: '0.0.0.0:9000'
RUSTFS_CONSOLE_ADDRESS: '0.0.0.0:9001'
RUSTFS_ACCESS_KEY: 'minioadmin'
RUSTFS_SECRET_KEY: 'minioadmin'
volumes:
- minio_data:/data
redis:
image: redis:7-alpine
container_name: unbound_redis
ports:
- "6379:6379"
backend:
build:
context: ./backend
args:
DEV: "1"
container_name: unbound_backend
# Dev: reload on code changes (the production compose file runs without it).
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
ports:
- "8000:8000"
volumes:
- ./backend:/app
extra_hosts: &host-gateway
- "host.docker.internal:host-gateway" # a local model server (LM Studio) on this machine
environment: &backend-env
DATABASE_URL: postgresql+asyncpg://unbound_user:unbound_password@postgres:5432/unbound_db
S3_ENDPOINT_URL: http://storage:9000
S3_ACCESS_KEY_ID: minioadmin
S3_SECRET_ACCESS_KEY: minioadmin
S3_BUCKET_NAME: unbound-docs
CORS_ORIGINS: "http://localhost:5173,http://localhost:3000"
# Set both in a root .env file (see .env.example). GOOGLE_CLIENT_ID must match the frontend's.
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET in .env}
ADMIN_EMAILS: ${ADMIN_EMAILS:-}
# AI agents (chat + document analysis). Without a key the rest of the app still works.
# LLM_PROVIDER: gemini, anthropic or local (LM Studio etc.); unset = gemini when GEMINI_API_KEY is set.
LLM_PROVIDER: ${LLM_PROVIDER:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
GEMINI_MODEL: ${GEMINI_MODEL:-gemini-3.5-flash}
GEMINI_FALLBACK_MODELS: ${GEMINI_FALLBACK_MODELS:-gemini-3-flash-preview,gemini-flash-latest}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
LOCAL_LLM_URL: ${LOCAL_LLM_URL:-http://host.docker.internal:1234/v1}
LOCAL_LLM_MODEL: ${LOCAL_LLM_MODEL:-qwen3-4b-instruct-2507}
LOCAL_LLM_CHAT_MODEL: ${LOCAL_LLM_CHAT_MODEL:-}
LOCAL_LLM_API_KEY: ${LOCAL_LLM_API_KEY:-}
ANTHROPIC_MODEL: ${ANTHROPIC_MODEL:-claude-opus-5-5}
AGENT_EFFORT: ${AGENT_EFFORT:-high}
# Manual guidelines verified longer ago than this are out of date; pipeline ones after PIPELINE_MAX_AGE_DAYS.
GUIDELINE_MAX_AGE_DAYS: ${GUIDELINE_MAX_AGE_DAYS:-90}
PIPELINE_MAX_AGE_DAYS: ${PIPELINE_MAX_AGE_DAYS:-3}
PIPELINE_HOUR_UTC: ${PIPELINE_HOUR_UTC:-3}
PIPELINE_ENABLED: ${PIPELINE_ENABLED:-true}
CHAT_RATE_LIMIT_PER_HOUR: ${CHAT_RATE_LIMIT_PER_HOUR:-60}
depends_on:
postgres:
condition: service_healthy
storage:
condition: service_started
# Document analysis queue + daily guidelines pipeline.
worker:
build:
context: ./backend
args:
DEV: "1"
container_name: unbound_worker
command: ["python", "-m", "app.worker"]
volumes:
- ./backend:/app
extra_hosts: *host-gateway
environment: *backend-env
depends_on:
postgres:
condition: service_healthy
storage:
condition: service_started
# Optional: the frontend dev server in Docker (npm run docker:up). Off by default so it doesn't
# clash with `npm run dev --prefix frontend` on the same port.
frontend:
profiles: ["frontend"]
build:
context: ./frontend
target: dev
container_name: unbound_frontend
ports:
- "5173:5173"
volumes:
- ./frontend:/app
# Keep the container's own node_modules (Linux binaries) instead of the host's.
- frontend_node_modules:/app/node_modules
environment:
VITE_API_URL: http://localhost:8000
VITE_GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
depends_on:
- backend
volumes:
postgres_data:
minio_data:
frontend_node_modules: