mirror of
https://github.com/latinogino/dolibarr-mcp.git
synced 2026-04-24 18:45:35 +02:00
Improve Docker Compose defaults and docs
This commit is contained in:
83
docker-compose.yml
Normal file
83
docker-compose.yml
Normal file
@@ -0,0 +1,83 @@
|
||||
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 (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: dolibarr-mcp-net
|
||||
|
||||
# To run the main server:
|
||||
# docker compose up -d
|
||||
#
|
||||
# To run tests:
|
||||
# docker compose --profile test up dolibarr-mcp-test
|
||||
Reference in New Issue
Block a user