forked from mtusi2026/mtusi2026lab3
51 lines
1.5 KiB
Bash
51 lines
1.5 KiB
Bash
# Copy to .env for your LOCAL synthetic test environment; never commit .env.
|
|
# Compose publishes only the load balancer; API replicas stay on its network.
|
|
|
|
APP_HOST=0.0.0.0
|
|
APP_PORT=8080
|
|
APP_ENV=lab
|
|
# INSTANCE_ID is intentionally unset: each container uses its own hostname.
|
|
# INSTANCE_ID=api-replica-01
|
|
|
|
POSTGRES_USER=messenger
|
|
POSTGRES_DB=messenger
|
|
|
|
SESSION_TTL_SECONDS=3600
|
|
SESSION_STORE=postgres
|
|
# Keep false only for local HTTP. Set true when the public entrypoint uses HTTPS.
|
|
SESSION_COOKIE_SECURE=false
|
|
CURSOR_SIGNING_KEY_FILE=/run/secrets/cursor_signing_key
|
|
|
|
API_REPLICAS=2
|
|
API_CPU_LIMIT=0.50
|
|
API_MEMORY_LIMIT=256M
|
|
IDEMPOTENCY_TTL_SECONDS=86400
|
|
|
|
# File paths contain no secret values. Create the referenced local secret files
|
|
# according to REPORT.md; never commit their contents.
|
|
DATABASE_URL_FILE=/run/secrets/database_url
|
|
|
|
DB_MAX_CONNS=10
|
|
DB_MIN_CONNS=2
|
|
DB_MAX_CONN_LIFETIME=30m
|
|
DB_MAX_CONN_IDLE_TIME=5m
|
|
DB_HEALTH_CHECK_PERIOD=30s
|
|
DB_CONNECT_TIMEOUT=5s
|
|
DB_QUERY_TIMEOUT=3s
|
|
|
|
READINESS_TIMEOUT=2s
|
|
SHUTDOWN_DRAIN_DELAY=2s
|
|
SHUTDOWN_TIMEOUT=10s
|
|
|
|
# Redis stores a disposable shared chat cache; PostgreSQL remains authoritative.
|
|
# The Go config accepts CACHE_URL or CACHE_URL_FILE, but never both. The
|
|
# transferred Compose baseline currently passes CACHE_URL directly.
|
|
CACHE_URL=redis://redis:6379/0
|
|
# CACHE_URL_FILE=/run/secrets/cache_url
|
|
CACHE_TTL=5m
|
|
CACHE_OPERATION_TIMEOUT=250ms
|
|
CACHE_POOL_SIZE=10
|
|
|
|
# Optional Redis Insight profile from the transferred baseline.
|
|
REDIS_INSIGHT_PORT=5540
|