docker-compose.ymlā¢4 kB
version: '3.8'
services:
hubspot-mcp-server:
# Use published image (recommended)
image: ghcr.io/sanketskasar/hubspot-mcp-server:latest
# Alternative: image: sanketskasar/hubspot-mcp-server:latest
# Uncomment to build locally instead of using published image
# build:
# context: .
# dockerfile: Dockerfile
# target: production
container_name: hubspot-mcp-server
restart: always
ports:
- "${HOST_PORT:-3000}:${CONTAINER_PORT:-3000}" # Configurable port mapping
environment:
# Required - HubSpot Private App Access Token
HUBSPOT_PRIVATE_APP_ACCESS_TOKEN: "${HUBSPOT_PRIVATE_APP_ACCESS_TOKEN}"
# Transport Configuration
TRANSPORT: http # http, streamable-http, stdio
PORT: ${CONTAINER_PORT:-3000} # Configurable container port
HOST: 0.0.0.0
# Application Settings
NODE_ENV: production
APP_NAME: hubspot-mcp-server
APP_VERSION: 1.0.0
LOG_LEVEL: info
# HubSpot API Configuration
HUBSPOT_API_URL: https://api.hubapi.com
# Security & CORS Configuration
CORS_ORIGIN: "*" # localhost, *, or specific domain
MAX_REQUEST_SIZE: 10485760 # 10MB
# Session Management
MAX_CONNECTIONS: 100
SESSION_TIMEOUT: 3600 # seconds
# Rate Limiting
RATE_LIMIT_TOOLS: 60 # requests per minute
RATE_LIMIT_RESOURCES: 30 # requests per minute
MAX_CONCURRENT_REQUESTS: 10 # per session
# Connection Configuration
CONNECTION_TIMEOUT: 30000 # milliseconds
GRACEFUL_SHUTDOWN_TIMEOUT: 10000 # milliseconds
# System Configuration
NODE_OPTIONS: "--max-old-space-size=512"
TZ: UTC
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${CONTAINER_PORT:-3000}/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# Resource limits (optional)
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
reservations:
memory: 256M
cpus: '0.25'
# Security hardening (optional)
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
read_only: true
tmpfs:
- /tmp:noexec,nosuid,size=100m
- /run:noexec,nosuid,size=50m
# Usage:
# 1. Set HUBSPOT_PRIVATE_APP_ACCESS_TOKEN in environment section above
# 2. Configure ports via HOST_PORT and CONTAINER_PORT environment variables
# 3. Configure transport type (http, streamable-http, stdio) via TRANSPORT env var
# 4. Run: docker-compose up -d
# 5. Access endpoints:
# - Health: http://localhost:${HOST_PORT:-3000}/health
# - Ready: http://localhost:${HOST_PORT:-3000}/ready
# - Metrics: http://localhost:${HOST_PORT:-3000}/metrics
# - Status: http://localhost:${HOST_PORT:-3000}/status
# - MCP HTTP: http://localhost:${HOST_PORT:-3000}/mcp/
# - MCP Stream: http://localhost:${HOST_PORT:-3000}/mcp/stream (if TRANSPORT=streamable-http)
# 6. Stop: docker-compose down
#
# Port Configuration:
# - HOST_PORT: Port on host machine (default: 3000)
# - CONTAINER_PORT: Port inside container (default: 3000)
# - Example: HOST_PORT=8080 CONTAINER_PORT=3000 docker-compose up -d
#
# Transport Types:
# - http: Standard HTTP JSON-RPC 2.0 transport
# - streamable-http: HTTP with Server-sent events for real-time updates
# - stdio: Process-based communication (requires docker exec for interaction)
#
# Configuration Notes:
# - All environment variables and ports are configurable
# - Rate limiting and session management are built-in
# - Supports up to 100 concurrent sessions by default
# - Comprehensive logging and monitoring available