# MCPTesta Docker Compose Configuration # Modern Docker Compose without version attribute x-logging: &default-logging driver: json-file options: max-size: "${LOG_MAX_SIZE:-10m}" max-file: "${LOG_MAX_FILES:-3}" x-healthcheck: &default-healthcheck interval: ${HEALTH_CHECK_INTERVAL:-30s} timeout: ${HEALTH_CHECK_TIMEOUT:-10s} retries: ${HEALTH_CHECK_RETRIES:-3} start_period: ${HEALTH_CHECK_START_PERIOD:-40s} services: # Documentation Site docs: build: context: ./docs dockerfile: Dockerfile target: ${NODE_ENV:-development} args: NODE_ENV: ${NODE_ENV:-development} environment: NODE_ENV: ${NODE_ENV:-development} HOST: ${DOCS_HOST:-0.0.0.0} PORT: ${DOCS_PORT:-4321} DOMAIN: ${DOMAIN:-mcptesta.l.supported.systems} labels: # Caddy Docker Proxy configuration caddy: ${DOCS_DOMAIN:-mcptesta.l.supported.systems} caddy.reverse_proxy: "{{upstreams 4321}}" caddy.encode: gzip caddy.header.Cache-Control: "public, max-age=31536000" caddy.header.X-Frame-Options: "SAMEORIGIN" caddy.header.X-Content-Type-Options: "nosniff" volumes: # Development: Mount source for hot reloading - ./docs:/app:${DEV_WATCH_ENABLED:-true} # Exclude node_modules from host mount - /app/node_modules healthcheck: <<: *default-healthcheck test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:4321/"] logging: *default-logging networks: - caddy - monitoring restart: unless-stopped deploy: resources: limits: cpus: ${DOCS_CPU_LIMIT:-0.5} memory: ${DOCS_MEMORY_LIMIT:-512m} reservations: memory: 256m # Security settings security_opt: - no-new-privileges:true read_only: false # Astro needs write access for builds tmpfs: - /tmp:noexec,nosuid,size=100m user: "1000:1000" # Optional: Documentation builder for production builds docs-builder: build: context: ./docs dockerfile: Dockerfile target: builder environment: NODE_ENV: production volumes: - ./docs:/app - docs_build:/app/dist profiles: - build command: npm run build networks: - internal networks: # External Caddy network for reverse proxy caddy: external: true name: caddy # Monitoring network monitoring: driver: bridge name: ${COMPOSE_PROJECT}_monitoring # Internal network for build processes internal: driver: bridge internal: true name: ${COMPOSE_PROJECT}_internal volumes: # Production build artifacts docs_build: driver: local name: ${COMPOSE_PROJECT}_docs_build