services: zp-agent-api: build: . 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: cl100k_base HF_HOME: /cache/huggingface 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 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: