-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
247 lines (237 loc) · 8.24 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
247 lines (237 loc) · 8.24 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# Production-style layout: postgres + fastapi + bff + web (+ optional mcp).
# The browser talks only to `bff`; FastAPI and Data are network-internal.
services:
postgres:
container_name: wp-postgres
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-website_profiling}
POSTGRES_USER: ${POSTGRES_USER:?set POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}
volumes:
- pg-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 5s
timeout: 3s
retries: 5
# One-shot EF Core schema migrator — runs to completion before any service that talks to
# Postgres starts. Replaces `alembic upgrade head` as schema owner (see services/Schema).
migrator:
container_name: wp-migrator
build:
context: ./services
dockerfile: Schema/Dockerfile
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
depends_on:
postgres:
condition: service_healthy
restart: "no"
fastapi:
container_name: wp-fastapi
build:
context: .
dockerfile: Dockerfile
image: website-profiling:latest
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully
environment:
WP_ROLE: fastapi
WEBSITE_PROFILING_ROOT: /app
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
DATA_DIR: /data
PYTHON: /opt/venv/bin/python
CHROME_PATH: /usr/bin/chromium
LIGHTHOUSE_PATH: /usr/local/bin/lighthouse
LIGHTHOUSE_CHROME_FLAGS: --headless --no-sandbox --disable-dev-shm-usage --disable-gpu
DEPRECATE_PYTHON_INTEGRATIONS: "1"
DEPRECATE_PYTHON_REPORT_ROUTES: "1"
REPORT_SERVICE_URL: http://report:8094
volumes:
- profiling-data:/data
healthcheck:
test: ['CMD', 'node', '-e', "require('http').get('http://127.0.0.1:8096/api/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
data:
container_name: wp-data
build:
context: .
dockerfile: services/Data/Dockerfile
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
ASPNETCORE_URLS: http://+:8091
WEBSITE_PROFILING_ROOT: /app
REPORT_API_URL: http://fastapi:8096
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully
fastapi:
condition: service_started
healthcheck:
test: ['CMD', 'curl', '-fsS', 'http://127.0.0.1:8091/health']
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
ai:
container_name: wp-ai
build:
context: ./services
dockerfile: AiService/Dockerfile
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
FASTAPI_URL: http://fastapi:8096
ASPNETCORE_URLS: http://+:8092
WP_MCP_HTTP: "1"
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully
fastapi:
condition: service_started
healthcheck:
test: ['CMD', 'curl', '-fsS', 'http://127.0.0.1:8092/health']
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
integrations:
container_name: wp-integrations
build:
context: ./services
dockerfile: IntegrationsService/Dockerfile
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
ASPNETCORE_URLS: http://+:8093
FASTAPI_URL: http://fastapi:8096
USE_FASTAPI_PYTHON_BRIDGE: "1"
ASPNETCORE_ENVIRONMENT: Production
AUTH_SECRET: ${AUTH_SECRET:?set AUTH_SECRET}
APP_PUBLIC_URL: ${APP_PUBLIC_URL:-}
GOOGLE_REDIRECT_URI: ${GOOGLE_REDIRECT_URI:-}
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully
fastapi:
condition: service_started
healthcheck:
test: ['CMD', 'curl', '-fsS', 'http://127.0.0.1:8093/health']
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
report:
container_name: wp-report
build:
context: .
dockerfile: services/ReportService/Dockerfile
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
ASPNETCORE_URLS: http://+:8094
FASTAPI_URL: http://fastapi:8096
INTEGRATIONS_SERVICE_URL: http://integrations:8093
AISERVICE_URL: http://ai:8092
REPORT_SERVICE_USE_PYTHON_BRIDGE: "0"
USE_FASTAPI_PYTHON_BRIDGE: "1"
REPORT_SERVICE_WORKER_ENABLED: "1"
depends_on:
postgres:
condition: service_healthy
migrator:
condition: service_completed_successfully
fastapi:
condition: service_started
integrations:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-fsS', 'http://127.0.0.1:8094/health']
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
bff:
container_name: wp-bff
build:
context: .
dockerfile: services/Bff/Dockerfile
depends_on:
fastapi:
condition: service_started
data:
condition: service_healthy
ai:
condition: service_healthy
integrations:
condition: service_healthy
report:
condition: service_healthy
ports:
- '${BFF_PORT:-8090}:8090'
environment:
FASTAPI_URL: http://fastapi:8096
DATA_SERVICE_URL: http://data:8091
AI_SERVICE_URL: http://ai:8092
INTEGRATIONS_SERVICE_URL: http://integrations:8093
REPORT_SERVICE_URL: http://report:8094
REPORT_ROUTES: "/api/compare,/api/dashboards,/api/run,/api/jobs,/api/schedule,/api/crawl"
DATA_ROUTES: "/api/report/meta,/api/report/payload,/api/report/history,/api/report/crawl-payload,/api/report/mobile-delta,/api/report/portfolio,/api/portfolio,/api/issues/status,/api/filters,/api/properties,/api/content-drafts,/api/content/score,/api/keywords,/api/page-markdown,/api/alerts,/api/logs,/api/backlinks"
AI_ROUTES: "/api/chat,/api/links/page-coach,/api/issues/fix-suggestion,/api/issues/action-plan,/api/ai/fix-suggestion,/api/dashboards/ai-generate,/api/content/analyze,/api/content/wizard,/api/llm-settings,/api/secrets,/api/ollama/status,/api/report/audit-tool,/api/mcp-tools"
INTEGRATIONS_ROUTES: "/api/integrations/google,/api/integrations/bing"
AUTH_SECRET: ${AUTH_SECRET:?set AUTH_SECRET}
AUTH_PASSWORD: ${AUTH_PASSWORD:-}
BFF_ALLOWED_ORIGINS: ${BFF_ALLOWED_ORIGINS:?set BFF_ALLOWED_ORIGINS (the public UI origin)}
# Cross-site cookie (frontend + BFF on a shared parent domain over HTTPS):
BFF_COOKIE_SAMESITE: ${BFF_COOKIE_SAMESITE:-None}
BFF_COOKIE_SECURE: ${BFF_COOKIE_SECURE:-true}
BFF_COOKIE_DOMAIN: ${BFF_COOKIE_DOMAIN:-}
web:
container_name: wp-web
build:
context: ./web
args:
VITE_BFF_BASE_URL: ${BFF_PUBLIC_URL:?set BFF_PUBLIC_URL (browser-facing BFF origin)}
depends_on:
bff:
condition: service_started
ports:
- '${WEB_PORT:-3000}:80'
healthcheck:
test: ['CMD', 'wget', '-qO-', 'http://127.0.0.1/home']
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
mcp:
container_name: wp-mcp
build:
context: ./services
dockerfile: AiService/Dockerfile
depends_on:
ai:
condition: service_healthy
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
FASTAPI_URL: http://fastapi:8096
ASPNETCORE_URLS: http://+:8092
WP_MCP_HTTP: "1"
WP_MCP_DOMAIN: ${WP_MCP_DOMAIN:-core}
WP_PROPERTY_ID: ${WP_PROPERTY_ID:-}
profiles:
- mcp
ports:
- '${MCP_PORT:-8000}:8092'
volumes:
pg-data:
profiling-data: