forked from mtusi2026/mtusi2026lab3
47 lines
1.4 KiB
Bash
47 lines
1.4 KiB
Bash
# AGENT: Copy to .env for your LOCAL synthetic test environment; never commit
|
|
# .env. compose.yaml reads these values. Only POSTGRES_PASSWORD is a secret.
|
|
APP_HOST=0.0.0.0
|
|
APP_PORT=8080
|
|
APP_ENV=lab
|
|
SESSION_TTL_SECONDS=3600
|
|
IDEMPOTENCY_TTL_SECONDS=86400
|
|
DB_POOL_MAX_CONNS=10
|
|
|
|
# Local PostgreSQL. The API receives a full DATABASE_URL built by compose.yaml.
|
|
POSTGRES_USER=messenger
|
|
POSTGRES_PASSWORD=replace-with-a-local-password
|
|
POSTGRES_DB=messenger
|
|
|
|
# Redis is the shared session store. AOF keeps absolute session TTLs.
|
|
SESSION_STORE=redis
|
|
|
|
# HAProxy is the only public API entrypoint. API replicas use expose, not ports.
|
|
LB_PORT=8080
|
|
HAPROXY_STATS_PORT=8404
|
|
|
|
# Per-replica and other services' resource limits.
|
|
# API_REPLICAS must stay within the 16 backend slots declared by
|
|
# server-template in infra/haproxy/haproxy.cfg.
|
|
API_REPLICAS=2
|
|
API_CPU_LIMIT=0.50
|
|
API_MEM_LIMIT=256M
|
|
POSTGRES_CPU_LIMIT=1.0
|
|
POSTGRES_MEM_LIMIT=512M
|
|
REDIS_CPU_LIMIT=0.50
|
|
REDIS_MEM_LIMIT=256M
|
|
HAPROXY_CPU_LIMIT=0.50
|
|
HAPROXY_MEM_LIMIT=128M
|
|
|
|
# K6 for detailed tests
|
|
K6_VUS=10
|
|
K6_DURATION=60
|
|
K6_CPU_LIMIT=1.0
|
|
K6_MEM_LIMIT=512M
|
|
|
|
# Optional overrides instead of the compose-generated URLs. A *_FILE value is
|
|
# read from a file, which is how Docker/Compose secrets are usually mounted.
|
|
# DATABASE_URL=postgres://messenger:password@localhost:5432/messenger?sslmode=disable
|
|
# DATABASE_URL_FILE=/run/secrets/database_url
|
|
# CACHE_URL=redis://localhost:6379/0
|
|
# CACHE_URL_FILE=/run/secrets/cache_url
|