-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
229 lines (214 loc) · 4.9 KB
/
docker-compose.dev.yml
File metadata and controls
229 lines (214 loc) · 4.9 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
# 基礎開發環境配置
version: '3.8'
services:
# GitHub MCP 服務器
github-mcp:
image: mcp/github
container_name: github-mcp-dev
environment:
- GITHUB_TOKEN=${GITHUB_TOKEN}
stdin_open: true
tty: true
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
mem_limit: 256m
cpus: 0.5
networks:
- mcp-backend
labels:
- "mcp.env=development"
- "mcp.server=github"
healthcheck:
test: ["CMD", "ps", "aux", "|", "grep", "node"]
interval: 30s
timeout: 10s
retries: 3
# 時間工具服務器
time-mcp:
image: mcp/time
container_name: time-mcp-dev
stdin_open: true
tty: true
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
mem_limit: 128m
cpus: 0.2
networks:
- mcp-backend
labels:
- "mcp.env=development"
- "mcp.server=time"
# Puppeteer 網頁自動化服務器
# Filesystem 服務器
filesystem-mcp:
image: mcp/filesystem
container_name: filesystem-mcp-dev
stdin_open: true
tty: true
restart: unless-stopped
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,size=100m
- /var/run:rw,noexec,nosuid,size=50m
security_opt:
- no-new-privileges:true
- seccomp:./config/seccomp-profiles/filesystem.json
- apparmor:mcp-filesystem-profile
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- FOWNER
user: "1001:1001"
mem_limit: 512m
cpus: 1.0
networks:
- mcp-dev-network
labels:
- "mcp.env=development"
- "mcp.server=filesystem"
puppeteer-mcp:
image: mcp/puppeteer
container_name: puppeteer-mcp-dev
environment:
- DOCKER_CONTAINER=true
stdin_open: true
tty: true
restart: unless-stopped
security_opt:
- no-new-privileges:true
mem_limit: 512m
cpus: 1.0
networks:
- mcp-backend
labels:
- "mcp.env=development"
- "mcp.server=puppeteer"
# 掛載共享記憶體 (Puppeteer 需要)
shm_size: 2gb
# PostgreSQL MCP 服務器 (可選)
postgres-mcp:
image: mcp/postgres
container_name: postgres-mcp-dev
environment:
- POSTGRES_URL=${POSTGRES_URL:-postgresql://postgres:password@postgres-db:5432/testdb}
stdin_open: true
tty: true
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
mem_limit: 256m
cpus: 0.5
networks:
- mcp-data
labels:
- "mcp.env=development"
- "mcp.server=postgres"
depends_on:
- postgres-db
# 測試用 PostgreSQL 資料庫
postgres-db:
image: postgres:15-alpine
container_name: postgres-db-dev
environment:
- POSTGRES_DB=testdb
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- mcp-data
labels:
- "mcp.env=development"
- "mcp.type=database"
# Redis (用於緩存和會話管理)
redis:
image: redis:7-alpine
container_name: redis-dev
command: redis-server --appendonly yes
volumes:
- redis_data:/data
networks:
- mcp-data
labels:
- "mcp.env=development"
- "mcp.type=cache"
# 監控和日誌收集
portainer:
image: portainer/portainer-ce:latest
container_name: portainer-dev
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
networks:
- mcp-frontend
labels:
- "mcp.env=development"
- "mcp.type=monitoring"
network-policy:
image: alpine/socat
command: ["sh", "-c", "iptables -I DOCKER-USER -s 172.20.0.0/24 -d 172.21.0.0/24 -j ACCEPT && iptables -I DOCKER-USER -j DROP"]
network_mode: host
privileged: true
volumes:
- /etc/iptables:/etc/iptables
networks:
mcp-frontend:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24
gateway: 172.20.0.1
driver_opts:
com.docker.network.bridge.enable_icc: "false"
labels:
- "mcp.env=development"
mcp-backend:
driver: bridge
internal: true
ipam:
config:
- subnet: 172.21.0.0/24
gateway: 172.21.0.1
labels:
- "mcp.env=development"
mcp-data:
driver: bridge
internal: true
ipam:
config:
- subnet: 172.22.0.0/24
gateway: 172.22.0.1
labels:
- "mcp.env=development"
volumes:
postgres_data:
driver: local
labels:
- "mcp.env=development"
- "mcp.type=database"
redis_data:
driver: local
labels:
- "mcp.env=development"
- "mcp.type=cache"
portainer_data:
driver: local
labels:
- "mcp.env=development"
- "mcp.type=monitoring"