-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (60 loc) · 1.82 KB
/
Copy pathdocker-compose.yml
File metadata and controls
64 lines (60 loc) · 1.82 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
version: '3.8'
services:
mcp-mysql-server:
build:
context: .
dockerfile: Dockerfile
target: production
ports:
- "${PORT:-3000}:${PORT:-3000}"
environment:
- PORT=${PORT:-3000}
- HOST=0.0.0.0
- AUTH_MODE=${AUTH_MODE:-none}
- AUTH_TOKEN=${AUTH_TOKEN:-}
- MYSQL_HOST=${MYSQL_HOST:-mysql}
- MYSQL_PORT=${MYSQL_PORT:-3306}
- MYSQL_USER=${MYSQL_USER:-root}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-password}
- MYSQL_DATABASE=${MYSQL_DATABASE:-test}
- RATE_LIMIT_REQUESTS_PER_MINUTE=${RATE_LIMIT_REQUESTS_PER_MINUTE:-60}
- RATE_LIMIT_BURST=${RATE_LIMIT_BURST:-10}
- REQUEST_TIMEOUT_SECONDS=${REQUEST_TIMEOUT_SECONDS:-30}
- MAX_REQUEST_SIZE_MB=${MAX_REQUEST_SIZE_MB:-10}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
depends_on:
mysql:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${PORT:-3000}/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
mysql:
image: mysql:8.0
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD:-password}
- MYSQL_DATABASE=${MYSQL_DATABASE:-test}
- MYSQL_USER=${MYSQL_USER:-testuser}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-password}
ports:
- "${MYSQL_PORT:-3306}:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_PASSWORD:-password}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
command: --default-authentication-plugin=mysql_native_password
volumes:
mysql_data:
driver: local
networks:
default:
name: mcp-mysql-network