compose.scale.yaml 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. # 与 compose.runtime.yaml 一起使用;API 通过 Docker DNS 自动登记到入口。
  2. services:
  3. api:
  4. ports: !reset []
  5. environment:
  6. ZHIFU_SSE_GLOBAL_LIMIT: ${ZHIFU_SSE_GLOBAL_LIMIT:-3000}
  7. ZHIFU_SSE_ACTOR_LIMIT: ${ZHIFU_SSE_ACTOR_LIMIT:-3}
  8. ZHIFU_POOL_SIZE: ${ZHIFU_SCALE_POOL_SIZE:-8}
  9. ZHIFU_MAX_OVERFLOW: ${ZHIFU_SCALE_MAX_OVERFLOW:-2}
  10. ulimits:
  11. nofile: {soft: 16384, hard: 16384}
  12. networks:
  13. dependencies:
  14. ingress:
  15. aliases: [api]
  16. gateway:
  17. image: haproxy:3.2-alpine
  18. restart: unless-stopped
  19. init: true
  20. read_only: true
  21. cap_drop: [ALL]
  22. security_opt: ["no-new-privileges:true"]
  23. pids_limit: 64
  24. mem_limit: 256m
  25. cpus: 1
  26. ulimits:
  27. nofile: {soft: 32768, hard: 32768}
  28. ports:
  29. - "127.0.0.1:${ZHIFU_GATEWAY_PORT:-28080}:8080"
  30. - "127.0.0.1:${ZHIFU_GATEWAY_METRICS_PORT:-28404}:8404"
  31. volumes: ["./ops/haproxy/runtime.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro"]
  32. networks: [ingress]
  33. networks:
  34. ingress: