Files
dolibarr-mcp/docker/docker-compose.yml
2025-12-28 13:37:24 +01:00

95 lines
2.3 KiB
YAML

services:
dolibarr-mcp:
build:
context: ..
dockerfile: docker/Dockerfile
image: dolibarr-mcp:latest
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
- 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
volumes:
# Mount configuration if needed
- ../.env:/app/.env:ro
# Optional: Mount for custom configurations or plugins
# - ./config:/app/config:ro
# - ./plugins:/app/plugins:ro
# Expose port for future HTTP interface
ports:
- "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: Include a test service
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
volumes:
- ../.env:/app/.env:ro
- ../test_dolibarr_mcp.py:/app/test_dolibarr_mcp.py:ro
command: python /app/test_dolibarr_mcp.py
profiles:
- test
networks:
- dolibarr-mcp-network
networks:
dolibarr-mcp-network:
driver: bridge
name: dolibarr-mcp-net
# To run the main server:
# docker-compose up
# To run tests:
# docker-compose --profile test up dolibarr-mcp-test