-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
191 lines (178 loc) · 5.5 KB
/
docker-compose.yml
File metadata and controls
191 lines (178 loc) · 5.5 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
x-app-env: &app_env
PYTHONPATH: /app
CG_CONFIG_TOML: /app/config.toml
PROJECT_ID: ${PROJECT_ID:-proj_mvp_001}
UV_PROJECT_ENVIRONMENT: /app/.venv.docker
ZAI_API_KEY: ${ZAI_API_KEY:-}
MINIMAX_API_KEY: ${MINIMAX_API_KEY:-}
MINIMAX_API_BASE: ${MINIMAX_API_BASE:-}
MOONSHOT_API_KEY: ${MOONSHOT_API_KEY:-}
MOONSHOT_API_BASE: ${MOONSHOT_API_BASE:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
ANTHROPIC_BASE_URL: ${ANTHROPIC_BASE_URL:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
OPENAI_BASE_URL: ${OPENAI_BASE_URL:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
GOOGLE_API_KEY: ${GOOGLE_API_KEY:-${GEMINI_API_KEY:-}}
CG__observability__otel__enabled: ${CG__observability__otel__enabled:-true}
CG__observability__otel__otlp_endpoint: ${CG__observability__otel__otlp_endpoint:-http://otel-collector:4318/v1/traces}
CG__observability__otel__sampler_ratio: ${CG__observability__otel__sampler_ratio:-1.0}
CG__observability__timing__enabled: ${CG__observability__timing__enabled:-true}
OTEL_PROPAGATORS: ${OTEL_PROPAGATORS:-tracecontext,baggage}
x-app-base: &app_base
build: .
working_dir: /app
volumes:
- .:/app
- ./config.docker.toml:/app/config.toml:ro
environment:
<<: *app_env
restart: unless-stopped
services:
jaeger:
image: jaegertracing/all-in-one:latest
environment:
COLLECTOR_OTLP_ENABLED: "true"
ports:
- "127.0.0.1:16686:16686"
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
command: ["--config=/etc/otelcol/config.yaml"]
volumes:
- ./observability/otel/otel-collector.jaeger.yaml:/etc/otelcol/config.yaml:ro
depends_on:
jaeger:
condition: service_started
ports:
- "127.0.0.1:4318:4318"
- "127.0.0.1:4317:4317"
- "127.0.0.1:13133:13133"
nats:
image: nats:2.10-alpine
command: ["-c", "/etc/nats/nats.conf"]
ports:
- "127.0.0.1:4222:4222"
- "127.0.0.1:8222:8222"
- "127.0.0.1:8080:8080"
volumes:
- ./nats.conf:/etc/nats/nats.conf:ro
- nats-data:/data
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8222/healthz"]
interval: 5s
timeout: 3s
retries: 20
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: cardbox
ports:
- "127.0.0.1:5433:5432"
volumes:
- pg-data:/var/lib/postgresql/data
- ./card-box-cg/card_box_core/adapters/postgres_schema.sql:/docker-entrypoint-initdb.d/00_core.sql:ro
- ./scripts/setup/init_db.sql:/docker-entrypoint-initdb.d/01_init.sql:ro
- ./scripts/setup/init_pmo_db.sql:/docker-entrypoint-initdb.d/02_init_pmo.sql:ro
- ./scripts/setup/init_projects.sql:/docker-entrypoint-initdb.d/03_init_projects.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d cardbox"]
interval: 5s
timeout: 3s
retries: 20
db-init:
<<: *app_base
restart: "no"
depends_on:
postgres:
condition: service_healthy
command: >-
sh -lc "uv sync &&
uv run -m scripts.setup.seed --ensure-schema --project $${PROJECT_ID}"
api:
<<: *app_base
environment:
<<: *app_env
CG_ENABLE_GOD_API: ${CG_ENABLE_GOD_API:-1}
depends_on:
otel-collector:
condition: service_started
nats:
condition: service_healthy
postgres:
condition: service_healthy
db-init:
condition: service_completed_successfully
ports:
- "127.0.0.1:${CG_API_HOST_PORT:-8099}:8099"
command: sh -lc "uv sync && uv run -m services.api"
pmo:
<<: *app_base
depends_on:
otel-collector:
condition: service_started
nats:
condition: service_healthy
postgres:
condition: service_healthy
db-init:
condition: service_completed_successfully
command: sh -lc "uv sync && uv run -m services.pmo.service"
agent-worker:
<<: *app_base
depends_on:
otel-collector:
condition: service_started
nats:
condition: service_healthy
postgres:
condition: service_healthy
db-init:
condition: service_completed_successfully
command: sh -lc "uv sync && uv run -m services.agent_worker.loop"
ui-worker:
<<: *app_base
depends_on:
otel-collector:
condition: service_started
nats:
condition: service_healthy
postgres:
condition: service_healthy
db-init:
condition: service_completed_successfully
command: sh -lc "uv sync && uv run -m services.ui_worker.loop"
mock-search:
<<: *app_base
environment:
<<: *app_env
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
MOCK_SEARCH_USE_LLM: ${MOCK_SEARCH_USE_LLM:-1}
MOCK_SEARCH_LLM_PROVIDER: ${MOCK_SEARCH_LLM_PROVIDER:-gemini}
MOCK_SEARCH_LLM_MODEL: ${MOCK_SEARCH_LLM_MODEL:-gemini/gemini-2.5-flash}
depends_on:
otel-collector:
condition: service_started
nats:
condition: service_healthy
postgres:
condition: service_healthy
db-init:
condition: service_completed_successfully
command: sh -lc "uv sync && uv run -m services.tools.mock_search"
word-count:
<<: *app_base
depends_on:
otel-collector:
condition: service_started
nats:
condition: service_healthy
postgres:
condition: service_healthy
db-init:
condition: service_completed_successfully
command: sh -lc "uv sync && uv run -m services.tools.word_count"
volumes:
nats-data:
pg-data: