-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
121 lines (115 loc) · 3.64 KB
/
docker-compose.prod.yml
File metadata and controls
121 lines (115 loc) · 3.64 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
# Production stack: MCP + control plane + Telegram bot + reverse proxy (Caddy).
# External HTTP(S) on ports 80/443 only; mcp-server listens on :3000 inside the Docker network.
# Configure Caddy via PUBLIC_HOST in `.env` (see OPERATOR.md).
# search: knowledge sidecar + public /knowledge (Swagger) and /knowledge/api/v1/* REST.
# mcp-server uses SEARCH_REST_API=true + SEARCH_API_URL=http://search:8790 (set in .env).
name: spawndock-api
services:
search:
build:
context: .
dockerfile: docker/search/Dockerfile
image: spawndock/search:prod
env_file:
- .env
environment:
QWEN_SEARCH_SERVER: "1"
SEARCH_SERVER: "1"
QWEN_HTTP_PORT: "8790"
QWEN_OAUTH: "true"
KNOWLEDGE_ROOT: /corpus
USAGE_DATABASE_PATH: /data/usage/events.sqlite
USAGE_ACTOR_SALT: ${USAGE_ACTOR_SALT:-change-me-usage-salt}
volumes:
- ./knowledge:/corpus:ro
- ./data/usage:/data/usage
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"node -e \"fetch('http://127.0.0.1:8790/knowledge/api/v1/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"",
]
interval: 25s
timeout: 8s
retries: 5
start_period: 90s
mcp-server:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
environment:
SEARCH_REST_API: "true"
SEARCH_API_URL: http://search:8790
QWEN_API_URL: http://search:8790
QWEN_CONTAINER_IMAGE: spawndock/search:prod
QWEN_KNOWLEDGE_HOST_PATH: ${QWEN_KNOWLEDGE_HOST_PATH:-}
USAGE_DATABASE_PATH: /data/usage/events.sqlite
USAGE_ACTOR_SALT: ${USAGE_ACTOR_SALT:-change-me-usage-salt}
OPS_USAGE_USER: ${OPS_USAGE_USER:-}
OPS_USAGE_PASSWORD: ${OPS_USAGE_PASSWORD:-}
volumes:
- ./data/state:/app/.spawndock
- ./knowledge:/app/knowledge:ro
- ./data/usage:/data/usage
depends_on:
search:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://127.0.0.1:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\""]
interval: 15s
timeout: 5s
retries: 5
start_period: 60s
restart: unless-stopped
bot:
build:
context: .
dockerfile: Dockerfile
command: ["node", "dist/bot/polling.js"]
env_file:
- .env
environment:
CONTROL_PLANE_URL: http://mcp-server:3000
USAGE_DATABASE_PATH: /data/usage/events.sqlite
USAGE_ACTOR_SALT: ${USAGE_ACTOR_SALT:-change-me-usage-salt}
volumes:
- ./data/usage:/data/usage
depends_on:
mcp-server:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://mcp-server:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\""]
interval: 30s
timeout: 5s
retries: 3
start_period: 45s
restart: unless-stopped
caddy:
image: caddy:2-alpine
ports:
- "80:80"
- "443:443"
environment:
PUBLIC_HOST: ${PUBLIC_HOST:-:80}
volumes:
- ./deploy/Caddyfile:/etc/caddy/Caddyfile:ro
- ./deploy/landing:/srv/landing:ro
- ./bot-resource:/srv/bot-resource:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
mcp-server:
condition: service_healthy
healthcheck:
test: ['CMD-SHELL', 'case "$$PUBLIC_HOST" in :*) curl -fsS "http://127.0.0.1$$PUBLIC_HOST/health" >/dev/null ;; *) curl -fsS -H "Host: $$PUBLIC_HOST" "http://127.0.0.1/health" >/dev/null ;; esac']
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
volumes:
caddy_data:
caddy_config: