| 12345678910111213141516171819202122232425262728293031323334 |
- # 与 compose.runtime.yaml 一起使用;API 通过 Docker DNS 自动登记到入口。
- services:
- api:
- ports: !reset []
- environment:
- ZHIFU_SSE_GLOBAL_LIMIT: ${ZHIFU_SSE_GLOBAL_LIMIT:-3000}
- ZHIFU_SSE_ACTOR_LIMIT: ${ZHIFU_SSE_ACTOR_LIMIT:-3}
- ZHIFU_POOL_SIZE: ${ZHIFU_SCALE_POOL_SIZE:-8}
- ZHIFU_MAX_OVERFLOW: ${ZHIFU_SCALE_MAX_OVERFLOW:-2}
- ulimits:
- nofile: {soft: 16384, hard: 16384}
- networks:
- dependencies:
- ingress:
- aliases: [api]
- gateway:
- image: haproxy:3.2-alpine
- restart: unless-stopped
- init: true
- read_only: true
- cap_drop: [ALL]
- security_opt: ["no-new-privileges:true"]
- pids_limit: 64
- mem_limit: 256m
- cpus: 1
- ulimits:
- nofile: {soft: 32768, hard: 32768}
- ports:
- - "127.0.0.1:${ZHIFU_GATEWAY_PORT:-28080}:8080"
- - "127.0.0.1:${ZHIFU_GATEWAY_METRICS_PORT:-28404}:8404"
- volumes: ["./ops/haproxy/runtime.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro"]
- networks: [ingress]
- networks:
- ingress:
|