Files
Genarrative/deploy/container/docker-compose.loadtest.yml
T
kdletters 071faa482c 统一 Rust 与 TypeScript 格式化门禁
纳入 AGC Cargo workspace 的统一 rustfmt 检查与格式化入口

完成项目 TypeScript/Prettier 与 Rust 全量格式化

修复 Pingora expected executable 门禁的空白敏感误报

同步开发运维文档与 AGC skill pack 格式化忽略规则
2026-09-01 16:28:34 +08:00

153 lines
4.1 KiB
YAML

name: genarrative-container-loadtest
services:
spacetimedb:
image: ${GENARRATIVE_CONTAINER_SPACETIME_IMAGE:-clockworklabs/spacetime:v2.8.3}
user: root
command:
[
'start',
'--listen-addr',
'0.0.0.0:3101',
'--data-dir',
'/var/lib/spacetimedb',
'--page_pool_max_size',
'402653184',
'--non-interactive',
]
cpus: '1.0'
mem_limit: 2g
ports:
- '${GENARRATIVE_CONTAINER_SPACETIME_PORT:-13101}:3101'
volumes:
- spacetime-data:/var/lib/spacetimedb
ulimits:
nofile:
soft: 4096
hard: 4096
healthcheck:
test:
[
'CMD-SHELL',
'spacetime server ping http://127.0.0.1:3101 >/dev/null 2>&1',
]
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
api-server:
build:
context: ../..
dockerfile: deploy/container/api-server.Dockerfile
target: api-runtime
cpus: '2.0'
mem_limit: 1g
env_file:
- ${GENARRATIVE_CONTAINER_API_ENV_FILE:-./api-server.env}
environment:
GENARRATIVE_API_HOST: 0.0.0.0
GENARRATIVE_API_PORT: 8082
OTEL_EXPORTER_OTLP_ENDPOINT: http://otelcol:4318
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
- api-tracking-outbox:/var/lib/genarrative/tracking-outbox
- api-wallet-refund-outbox:/var/lib/genarrative/wallet-refund-outbox
ulimits:
nofile:
soft: 4096
hard: 4096
depends_on:
spacetimedb:
condition: service_healthy
otelcol:
condition: service_started
healthcheck:
test: ['CMD', 'curl', '-fsS', 'http://127.0.0.1:8082/healthz']
interval: 10s
timeout: 3s
retries: 12
start_period: 20s
external-generation-worker:
build:
context: ../..
dockerfile: deploy/container/api-server.Dockerfile
target: api-runtime
cpus: '2.0'
mem_limit: 1g
env_file:
- ${GENARRATIVE_CONTAINER_API_ENV_FILE:-./api-server.env}
environment:
GENARRATIVE_PROCESS_ROLE: external-generation-worker
GENARRATIVE_TRACKING_OUTBOX_DIR: /var/lib/genarrative/tracking-outbox-worker
OTEL_EXPORTER_OTLP_ENDPOINT: http://otelcol:4318
OTEL_SERVICE_NAME: genarrative-external-generation-worker
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
- external-generation-tracking-outbox:/var/lib/genarrative/tracking-outbox-worker
- external-generation-wallet-refund-outbox:/var/lib/genarrative/wallet-refund-outbox
ulimits:
nofile:
soft: 4096
hard: 4096
depends_on:
spacetimedb:
condition: service_healthy
otelcol:
condition: service_started
nginx:
build:
context: ../..
dockerfile: deploy/container/api-server.Dockerfile
target: nginx-runtime
cpus: '0.5'
mem_limit: 128m
depends_on:
api-server:
condition: service_healthy
spacetimedb:
condition: service_healthy
ports:
- '${GENARRATIVE_CONTAINER_HTTP_PORT:-18080}:80'
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
- nginx-logs:/var/log/nginx
ulimits:
nofile:
soft: 4096
hard: 4096
healthcheck:
test: ['CMD', 'wget', '-qO-', 'http://127.0.0.1/']
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
otelcol:
image: otel/opentelemetry-collector-contrib:0.151.0
command: ['--config=/etc/otelcol/config.yaml']
cpus: '0.25'
mem_limit: 128m
environment:
GRAFANA_CLOUD_OTLP_ENDPOINT: ${GRAFANA_CLOUD_OTLP_ENDPOINT:-}
GRAFANA_CLOUD_BASIC_AUTH_HEADER: ${GRAFANA_CLOUD_BASIC_AUTH_HEADER:-}
HOSTNAME: ${HOSTNAME:-genarrative-container-loadtest}
volumes:
- ${GENARRATIVE_CONTAINER_OTELCOL_CONFIG:-./otelcol.yaml}:/etc/otelcol/config.yaml:ro
ports:
- '${GENARRATIVE_CONTAINER_OTLP_GRPC_PORT:-4317}:4317'
- '${GENARRATIVE_CONTAINER_OTLP_HTTP_PORT:-4318}:4318'
volumes:
spacetime-data:
api-tracking-outbox:
api-wallet-refund-outbox:
external-generation-tracking-outbox:
external-generation-wallet-refund-outbox:
nginx-logs: