services: danbooru-mcp: build: context: . dockerfile: Dockerfile.prebuilt image: danbooru-mcp:latest container_name: danbooru-mcp stdin_open: true # required — MCP communicates over stdio tty: false restart: unless-stopped environment: DANBOORU_TAGS_DB: /app/db/tags.db # Log level: DEBUG | INFO | WARNING | ERROR | CRITICAL (default: INFO) LOG_LEVEL: ${LOG_LEVEL:-INFO} # Log format: "text" (human-readable) | "json" (structured, for log aggregators) LOG_FORMAT: ${LOG_FORMAT:-text} volumes: # Persistent DB volume — survives image rebuilds. # On first use, seed with: # docker run --rm \ # -v danbooru_db:/target -v $(pwd)/db:/source \ # alpine sh -c "cp /source/tags.db /target/" - danbooru_db:/app/db # Docker logging driver — captures all stderr output from the container. # Use "json-file" (default) for local development; switch to "journald" # or a remote driver (fluentd, awslogs, etc.) for production. logging: driver: json-file options: max-size: "50m" # rotate when log file reaches 50MB max-file: "5" # keep last 5 rotated files read_only: true tmpfs: - /tmp volumes: danbooru_db: driver: local