docker-compose.ymlโข2.85 kB
services:
autotask-mcp:
build:
context: .
dockerfile: Dockerfile
target: production
image: autotask-mcp:latest
container_name: autotask-mcp-server
restart: unless-stopped
env_file:
- .env
environment:
# Required Autotask credentials (set these in .env file)
- AUTOTASK_USERNAME=${AUTOTASK_USERNAME}
- AUTOTASK_SECRET=${AUTOTASK_SECRET}
- AUTOTASK_INTEGRATION_CODE=${AUTOTASK_INTEGRATION_CODE}
# Optional configuration
- AUTOTASK_API_URL=${AUTOTASK_API_URL:-}
- MCP_SERVER_NAME=${MCP_SERVER_NAME:-autotask-mcp}
- MCP_SERVER_VERSION=${MCP_SERVER_VERSION:-1.0.0}
# Logging configuration
- LOG_LEVEL=${LOG_LEVEL:-info}
- LOG_FORMAT=${LOG_FORMAT:-json}
- NODE_ENV=production
volumes:
# Mount logs directory for persistence
- autotask-mcp-logs:/app/logs
# Note: MCP servers typically use stdio transport, not HTTP
# If you need HTTP interface in the future, uncomment the ports section
# ports:
# - "8080:8080"
# Health check
healthcheck:
test: ["CMD", "node", "-e", "console.log('Health check passed')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Resource limits for production use
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 128M
# Development service - runs once for testing, doesn't restart
autotask-mcp-dev:
profiles: ["dev"]
build:
context: .
dockerfile: Dockerfile
target: builder
image: autotask-mcp:dev
container_name: autotask-mcp-dev
working_dir: /app
restart: "no" # Don't restart in dev mode
command: npm run dev
environment:
# Development environment variables
- NODE_ENV=development
- LOG_LEVEL=${LOG_LEVEL:-debug}
- LOG_FORMAT=${LOG_FORMAT:-simple}
# Autotask credentials
- AUTOTASK_USERNAME=${AUTOTASK_USERNAME}
- AUTOTASK_SECRET=${AUTOTASK_SECRET}
- AUTOTASK_INTEGRATION_CODE=${AUTOTASK_INTEGRATION_CODE}
- AUTOTASK_API_URL=${AUTOTASK_API_URL:-}
env_file:
- .env
volumes:
# Mount source code for hot reload in development
- .:/app
- /app/node_modules
- autotask-mcp-dev-logs:/app/logs
stdin_open: true
tty: true
volumes:
autotask-mcp-logs:
driver: local
autotask-mcp-dev-logs:
driver: local
# Example .env file structure (create this file with your actual credentials):
# AUTOTASK_USERNAME=your-api-user@example.com
# AUTOTASK_SECRET=your-secret-key
# AUTOTASK_INTEGRATION_CODE=your-integration-code
# AUTOTASK_API_URL=https://webservices.autotask.net/atservices/1.6/atws.asmx
# LOG_LEVEL=info
# LOG_FORMAT=json