Files
dolibarr-mcp/docker-compose.yml
2026-02-04 17:00:13 +01:00

85 lines
2.1 KiB
YAML

services:
dolibarr-mcp:
build:
context: .
dockerfile: docker/Dockerfile
image: dolibarr-mcp:latest
container_name: ${MCP_CONTAINER_NAME:-dolibarr-mcp-server}
restart: unless-stopped
environment:
# Dolibarr API Configuration
DOLIBARR_URL: ${DOLIBARR_URL:-https://your-dolibarr-instance.com/api/index.php}
DOLIBARR_API_KEY: ${DOLIBARR_API_KEY:-your_api_key_here}
# Logging Configuration
LOG_LEVEL: ${LOG_LEVEL:-INFO}
PYTHONUNBUFFERED: 1
# MCP Server Configuration (HTTP listener by default)
MCP_TRANSPORT: ${MCP_TRANSPORT:-http}
MCP_HTTP_PORT: ${MCP_HTTP_PORT:-8080}
MCP_HTTP_HOST: ${MCP_HTTP_HOST:-0.0.0.0}
MCP_SERVER_NAME: dolibarr-mcp
MCP_SERVER_VERSION: 1.0.0
# Expose port for HTTP MCP clients
ports:
- "${MCP_HOST_PORT:-18004}:8080"
# Health check
healthcheck:
test: ["CMD", "python", "-c", "import sys; from src.dolibarr_mcp.config import Config; sys.exit(0 if Config().api_key else 1)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Resource limits
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
# Logging
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- dolibarr-mcp-network
# Optional: Connection check (run on demand)
dolibarr-mcp-test:
build:
context: .
dockerfile: docker/Dockerfile
image: dolibarr-mcp:latest
container_name: dolibarr-mcp-test
environment:
DOLIBARR_URL: ${DOLIBARR_URL}
DOLIBARR_API_KEY: ${DOLIBARR_API_KEY}
LOG_LEVEL: DEBUG
command: python -m dolibarr_mcp.test_connection
profiles:
- test
networks:
- dolibarr-mcp-network
networks:
dolibarr-mcp-network:
driver: bridge
name: ${MCP_NETWORK_NAME:-dolibarr-mcp-net}
external: ${MCP_NETWORK_EXTERNAL:-false}
# To run the main server:
# docker compose up -d
#
# To run tests:
# docker compose --profile test up dolibarr-mcp-test