name: zp-agent services: zp-agent-api: build: context: .. dockerfile: deployment/Dockerfile args: EMBEDDING_MODEL: ${EMBEDDING_MODEL:-intfloat/multilingual-e5-small} EMBEDDING_REVISION: ${EMBEDDING_REVISION:-} CHUNK_TOKEN_ENCODING: ${CHUNK_TOKEN_ENCODING:-cl100k_base} RAG_LLM_TOKEN_ENCODING: ${RAG_LLM_TOKEN_ENCODING:-cl100k_base} container_name: zp-agent-api ports: - "8000:8000" env_file: - ../.env environment: ZPWIKI_ROOT: /zpwiki CHUNK_MAX_TOKENS: "450" CHUNK_OVERLAP_TOKENS: "70" CHUNK_MIN_TOKENS: "80" CHUNK_TOKEN_ENCODING: ${CHUNK_TOKEN_ENCODING:-cl100k_base} RAG_LLM_MAX_TOKENS: ${RAG_LLM_MAX_TOKENS:-12000} RAG_LLM_TOKEN_ENCODING: ${RAG_LLM_TOKEN_ENCODING:-cl100k_base} HF_HOME: /cache/huggingface HF_HUB_OFFLINE: "1" TRANSFORMERS_OFFLINE: "1" ZP_RUNTIME_ASSETS: /opt/zp-assets ZP_ASSETS_REQUIRED: "1" GIT_SSH_COMMAND: >- ssh -F /dev/null -i /run/secrets/zpwiki_ssh_key -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/run/secrets/zpwiki_known_hosts -o ConnectTimeout=15 NEO4J_URI: bolt://neo4j:7687 NEO4J_USER: ${NEO4J_USER:-neo4j} NEO4J_PASSWORD: ${NEO4J_PASSWORD} NEO4J_DATABASE: ${NEO4J_DATABASE:-neo4j} volumes: - ../data:/app/data - ../../zpwiki:/zpwiki - hf-cache:/cache/huggingface - type: bind source: ${ZPWIKI_SSH_KEY:-${HOME}/.ssh/id_ed25519} target: /run/secrets/zpwiki_ssh_key read_only: true bind: create_host_path: false - type: bind source: ${ZPWIKI_KNOWN_HOSTS:-${HOME}/.ssh/known_hosts} target: /run/secrets/zpwiki_known_hosts read_only: true bind: create_host_path: false restart: unless-stopped stop_grace_period: 5m depends_on: neo4j: condition: service_healthy healthcheck: test: ["CMD", "python", "-m", "tools.runtime.runtime_health"] interval: 15s timeout: 10s retries: 12 start_period: 90s neo4j: image: neo4j:2026.09.0 container_name: zp-agent-neo4j ports: - "127.0.0.1:7474:7474" - "127.0.0.1:7687:7687" environment: NEO4J_AUTH: ${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD} volumes: - neo4j-data:/data - neo4j-logs:/logs healthcheck: test: [ "CMD-SHELL", "u=$${NEO4J_AUTH%%/*}; p=$${NEO4J_AUTH#*/}; cypher-shell -u \"$$u\" -p \"$$p\" 'RETURN 1' >/dev/null 2>&1" ] interval: 10s timeout: 5s retries: 10 start_period: 20s restart: unless-stopped volumes: hf-cache: neo4j-data: neo4j-logs: