mirror of
https://github.com/latinogino/dolibarr-mcp.git
synced 2026-04-11 21:45:34 +02:00
94 lines
2.2 KiB
YAML
94 lines
2.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
dolibarr-mcp:
|
|
build:
|
|
context: .
|
|
dockerfile: 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_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:
|
|
- "8080: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: 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
|