name: zhifu-runtime x-runtime: &runtime image: ${ZHIFU_IMAGE:-zhifu-platform:local} env_file: ${ZHIFU_RUNTIME_ENV:?Specify an absolute runtime environment file path} init: true read_only: true tmpfs: ["/app/.work:uid=10001,gid=10001,mode=0700"] cap_drop: [ALL] security_opt: ["no-new-privileges:true"] stop_grace_period: 75s restart: unless-stopped pids_limit: 256 mem_limit: 1g cpus: 2 logging: driver: json-file options: {max-size: "10m", max-file: "3"} networks: [dependencies] services: api: <<: *runtime environment: DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-} ports: ["127.0.0.1:${ZHIFU_API_PORT:-28000}:8000"] healthcheck: test: [CMD, python, -c, "import httpx; httpx.get('http://127.0.0.1:8000/health/ready', timeout=4).raise_for_status()"] interval: 10s timeout: 5s retries: 3 start_period: 30s oms: <<: *runtime command: [uvicorn, "zhifu.oms.api:create_app", --factory, --host, "0.0.0.0", --port, "8100", --timeout-graceful-shutdown, "60"] ports: ["127.0.0.1:${ZHIFU_OMS_PORT:-28100}:8100"] healthcheck: test: [CMD, python, -c, "import httpx; httpx.get('http://127.0.0.1:8100/health', timeout=4).raise_for_status()"] interval: 10s timeout: 5s retries: 3 start_period: 30s operations: <<: *runtime command: [uvicorn, "zhifu.monitoring.api:app", --host, "0.0.0.0", --port, "8300"] ports: ["127.0.0.1:28300:8300"] agent: <<: *runtime profiles: [workers] environment: DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-} command: [python, -m, zhifu.operations.worker, agent] memory: <<: *runtime profiles: [workers] environment: DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-} command: [python, -m, zhifu.operations.worker, memory] fulfillment: <<: *runtime profiles: [workers] command: [python, -m, zhifu.operations.worker, fulfillment] knowledge: <<: *runtime profiles: [workers] command: [python, -m, zhifu.operations.worker, knowledge] channel-delivery: <<: *runtime profiles: [workers] command: [python, -m, zhifu.operations.worker, channel-delivery] migrate: <<: *runtime profiles: [release] restart: "no" command: [alembic, upgrade, head] migrate-oms: <<: *runtime profiles: [release] restart: "no" command: [alembic, -c, oms-alembic.ini, upgrade, head] release-check: <<: *runtime profiles: [release] environment: DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-} restart: "no" command: [python, -m, zhifu.operations.release_check] inference: <<: *runtime image: ${ZHIFU_INFERENCE_IMAGE:-zhifu-inference:local} profiles: [inference] command: [uvicorn, "zhifu.modules.knowledge.inference:app", --host, "0.0.0.0", --port, "8200", --timeout-graceful-shutdown, "60"] environment: KNOWLEDGE_MODEL_CACHE: /models HF_HUB_OFFLINE: "1" HF_HOME: /app/.work/huggingface volumes: ["${ZHIFU_MODEL_PATH:?Specify the BGE model cache path}:/models:ro"] mem_limit: 6g cpus: 4 ports: ["127.0.0.1:28200:8200"] healthcheck: test: [CMD, python, -c, "import httpx; httpx.get('http://127.0.0.1:8200/health/ready', timeout=4).raise_for_status()"] interval: 10s timeout: 5s retries: 6 start_period: 120s networks: dependencies: external: true name: ${ZHIFU_DEPENDENCY_NETWORK:-zhifu-platform_default}