docker-compose.ymlโข2.45 kB
# Docker Compose file for SonicWall MCP Server
# Uses latest Compose Specification format (no version field needed)
services:
sonicwall-mcp:
build:
context: .
target: production
container_name: sonicwall-mcp-server
restart: unless-stopped
ports:
- "${PORT:-3000}:3000"
environment:
# SonicWall Configuration (Required)
- SONICWALL_HOST=${SONICWALL_HOST}
- SONICWALL_USERNAME=${SONICWALL_USERNAME}
- SONICWALL_PASSWORD=${SONICWALL_PASSWORD}
- SONICWALL_VERSION=${SONICWALL_VERSION:-7}
# Server Configuration
- PORT=${PORT:-3000}
- MCP_TRANSPORT=sse
- LOG_LEVEL=${LOG_LEVEL:-info}
# Cache Configuration
- CACHE_TTL_SECONDS=${CACHE_TTL_SECONDS:-300}
# Optional Authentication
- MCP_BEARER_TOKEN=${MCP_BEARER_TOKEN:-}
# Node.js Configuration
- NODE_ENV=${NODE_ENV:-production}
networks:
- sonicwall-network
volumes:
# Optional: Mount logs directory for persistent logging
- ./logs:/app/logs:rw
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Resource limits (Docker Compose format)
mem_limit: 512m
mem_reservation: 256m
cpus: 1.0
# Security settings
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp:size=100M,noexec,nosuid,nodev
# Optional: Add Nginx reverse proxy for SSL termination
nginx:
image: nginx:alpine
container_name: sonicwall-mcp-proxy
profiles:
- proxy
ports:
- "443:443"
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- sonicwall-mcp
networks:
- sonicwall-network
restart: unless-stopped
networks:
sonicwall-network:
driver: bridge
name: sonicwall-mcp-network
# Development override file can be created as docker-compose.override.yml
# Example override for development:
# services:
# sonicwall-mcp:
# build:
# target: builder
# command: npm run dev
# volumes:
# - ./src:/app/src:ro
# - ./package*.json:/app/:ro
# environment:
# - NODE_ENV=development
# - LOG_LEVEL=debug