-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
134 lines (112 loc) · 3.57 KB
/
Copy pathdocker-compose.yml
File metadata and controls
134 lines (112 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
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
# =============================================================================
# Docker Compose for dtools-mcp
# =============================================================================
# This compose file provides:
# - mcp-server: The main MCP server
# - mock-api: Optional mock D-Tools API for testing/development
#
# Usage:
# docker-compose up -d # Start MCP server
# docker-compose up -d mcp-server # Start only MCP server
# docker-compose up -d mock-api # Start only mock API
# docker-compose down # Stop all services
# docker-compose logs -f # Follow logs
# =============================================================================
version: '3.8'
services:
# ===========================================================================
# MCP Server Service
# ===========================================================================
mcp-server:
build:
context: .
dockerfile: Dockerfile
target: production
image: dtools-mcp:latest
container_name: dtools-mcp-server
restart: unless-stopped
environment:
# D-Tools API Configuration
- DTOOLS_API_URL=${DTOOLS_API_URL:-https://api.d-tools.com}
- DTOOLS_API_KEY=${DTOOLS_API_KEY:-}
- WEBHOOK_SECRET=${WEBHOOK_SECRET:-}
# Server Configuration
- WEBHOOK_PORT=${WEBHOOK_PORT:-3000}
- LOG_LEVEL=${LOG_LEVEL:-info}
# Optional: Point to mock API for testing
# Uncomment the following line to use mock API
# - DTOOLS_API_URL=http://mock-api:3456
ports:
# Webhook port (optional)
- '${MCP_WEBHOOK_PORT:-3000}:3000'
volumes:
# Persist logs
- mcp-logs:/app/logs
# Optional: Mount .env file for local development
# - ./.env:/app/.env:ro
healthcheck:
test: ['CMD', 'node', '-e', "console.log('health check')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# Security options
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp:noexec,nosuid,size=100m
# Resource limits
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
networks:
- mcp-network
# ===========================================================================
# Mock API Service (Optional - for development/testing)
# ===========================================================================
mock-api:
build:
context: .
dockerfile: Dockerfile.mock-api
image: dtools-mcp-mock-api:latest
container_name: dtools-mcp-mock
restart: unless-stopped
environment:
- MOCK_API_PORT=${MOCK_API_PORT:-3456}
- NODE_ENV=development
ports:
- '${MOCK_API_PORT:-3456}:3456'
healthcheck:
test: ['CMD', 'wget', '-qO-', 'http://localhost:3456/health']
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
networks:
- mcp-network
# Only start when explicitly requested or profile is active
profiles:
- mock
- dev
- testing
# =============================================================================
# Volumes
# =============================================================================
volumes:
mcp-logs:
driver: local
# =============================================================================
# Networks
# =============================================================================
networks:
mcp-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16