forked from hongkongkiwi/docx-mcp
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (95 loc) · 3.57 KB
/
Copy pathdocker-compose.yml
File metadata and controls
99 lines (95 loc) · 3.57 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
# =============================================================================
# docx-mcp — Full Stack Docker Compose
#
# All services start together: R2 storage + Google Drive sync + MCP server + proxy
#
# Usage:
# source infra/env-setup.sh && docker compose up -d # Start all
# source infra/env-setup.sh && docker compose up -d --build # Rebuild + start
#
# Environment (source infra/env-setup.sh before docker compose):
# # Cloudflare (R2 storage + proxy auth)
# CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, D1_DATABASE_ID
# R2_BUCKET_NAME, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY
#
# # Google Drive OAuth (tokens stored per-tenant in D1)
# OAUTH_GOOGLE_CLIENT_ID, OAUTH_GOOGLE_CLIENT_SECRET
# WATCH_POLL_INTERVAL (default: 60)
# =============================================================================
services:
# ─── R2 Storage (StorageService gRPC) ──────────────────────────────────────
storage:
build: { context: ., dockerfile: Dockerfile.storage-cloudflare }
environment:
RUST_LOG: "info,docx_storage_cloudflare=debug"
GRPC_HOST: "0.0.0.0"
GRPC_PORT: "50051"
CLOUDFLARE_ACCOUNT_ID: ${CLOUDFLARE_ACCOUNT_ID}
R2_BUCKET_NAME: ${R2_BUCKET_NAME}
R2_ACCESS_KEY_ID: ${R2_ACCESS_KEY_ID}
R2_SECRET_ACCESS_KEY: ${R2_SECRET_ACCESS_KEY}
ports:
- "50051:50051"
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "50051"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# ─── Google Drive (SourceSyncService + ExternalWatchService gRPC) ──────────
gdrive:
build: { context: ., dockerfile: Dockerfile.gdrive }
environment:
RUST_LOG: info
GRPC_HOST: "0.0.0.0"
GRPC_PORT: "50052"
CLOUDFLARE_ACCOUNT_ID: ${CLOUDFLARE_ACCOUNT_ID}
CLOUDFLARE_API_TOKEN: ${CLOUDFLARE_API_TOKEN}
D1_DATABASE_ID: ${D1_DATABASE_ID}
GOOGLE_CLIENT_ID: ${OAUTH_GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${OAUTH_GOOGLE_CLIENT_SECRET}
WATCH_POLL_INTERVAL: ${WATCH_POLL_INTERVAL:-60}
ports:
- "50052:50052"
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "50052"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# ─── MCP Server (.NET NativeAOT, dual-server: R2 history + gdrive sync) ───
mcp-http:
build: { context: ., dockerfile: Dockerfile }
depends_on:
storage: { condition: service_healthy }
gdrive: { condition: service_healthy }
environment:
MCP_TRANSPORT: http
ASPNETCORE_URLS: http://+:3000
STORAGE_GRPC_URL: http://storage:50051
SYNC_GRPC_URL: http://gdrive:50052
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:3000/health"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# ─── Auth Proxy (PAT auth via D1 + HTTP reverse proxy) ────────────────────
proxy:
build: { context: ., dockerfile: Dockerfile.proxy }
depends_on:
mcp-http: { condition: service_healthy }
environment:
RUST_LOG: "info,docx_mcp_sse_proxy=debug"
MCP_BACKEND_URL: http://mcp-http:3000
CLOUDFLARE_ACCOUNT_ID: ${CLOUDFLARE_ACCOUNT_ID}
CLOUDFLARE_API_TOKEN: ${CLOUDFLARE_API_TOKEN}
D1_DATABASE_ID: ${D1_DATABASE_ID}
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped