-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
81 lines (77 loc) · 2.45 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
81 lines (77 loc) · 2.45 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
# Production-style layout: postgres + web + worker (same image, different command).
services:
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
web:
build:
context: .
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
ports:
- '${WEB_PORT:-3000}:3000'
environment:
WEBSITE_PROFILING_ROOT: /app
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
DATA_DIR: /data
AUTH_SECRET: ${AUTH_SECRET:?set AUTH_SECRET}
AUTH_PASSWORD: ${AUTH_PASSWORD:-}
NODE_ENV: production
volumes:
- profiling-data:/data
healthcheck:
test: ['CMD', 'node', '-e', "require('http').get('http://127.0.0.1:3000/api/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"]
interval: 30s
timeout: 5s
retries: 3
worker:
build:
context: .
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
command: ['python', '-m', 'src', 'report']
environment:
WEBSITE_PROFILING_ROOT: /app
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
DATA_DIR: /data
volumes:
- profiling-data:/data
profiles:
- worker
mcp:
build:
context: .
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
command: ['python', '-m', 'website_profiling.mcp.http']
environment:
WEBSITE_PROFILING_ROOT: /app
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-website_profiling}
WP_MCP_HTTP_HOST: 0.0.0.0
WP_MCP_HTTP_PORT: 8000
WP_MCP_TOKEN: ${WP_MCP_TOKEN:?set WP_MCP_TOKEN}
WP_MCP_ALLOWED_HOSTS: ${WP_MCP_ALLOWED_HOSTS:-}
WP_MCP_ALLOWED_ORIGINS: ${WP_MCP_ALLOWED_ORIGINS:-}
WP_MCP_DOMAIN: ${WP_MCP_DOMAIN:-core}
WP_PROPERTY_ID: ${WP_PROPERTY_ID:-}
ports:
- '${MCP_PORT:-8000}:8000'
volumes:
pg-data:
profiling-data: