# Copy to .env for your LOCAL synthetic test environment; never commit .env. # Names follow pydantic-settings: prefix APP_CONFIG__, nesting via "__" (see app/core/config.py). # Mapping to the skeleton's logical names: APP_HOST -> APP_CONFIG__RUN__HOST, APP_PORT -> APP_CONFIG__RUN__PORT, # DATABASE_URL_FILE -> APP_CONFIG__DB__* (host/port/name/user + password file), # SESSION_TTL_SECONDS -> APP_CONFIG__JWT__SESSION_TTL_SECONDS, SESSION_STORE=postgres (sessions table), # IDEMPOTENCY_TTL_SECONDS -> APP_CONFIG__IDEMPOTENCY__TTL_SECONDS, API_REPLICAS -> API_REPLICAS (compose.yaml). # S3_ENDPOINT/S3_REGION -> APP_CONFIG__S3__ENDPOINT/REGION, S3_BUCKET -> S3_BUCKET (compose.yaml), # S3_ACCESS_KEY_ID_FILE/S3_SECRET_ACCESS_KEY_FILE -> APP_CONFIG__S3__ACCESS_KEY_FILE/SECRET_KEY_FILE, # MAX_UPLOAD_BYTES/MAX_IMAGE_PIXELS -> APP_CONFIG__ATTACHMENTS__MAX_BYTES/MAX_PIXELS (defaults = contract limits). APP_CONFIG__RUN__HOST=0.0.0.0 APP_CONFIG__RUN__PORT=8080 APP_CONFIG__LOGGING__LEVEL=INFO # PostgreSQL. Values below are for running the API from the venv on the host; # inside Compose the defaults (host=postgres, /run/secrets/postgres_password) are used. APP_CONFIG__DB__HOST=127.0.0.1 APP_CONFIG__DB__PORT=5432 APP_CONFIG__DB__NAME=messenger APP_CONFIG__DB__USER=messenger # Path only, never the password itself. Relative paths are resolved from the project root. APP_CONFIG__DB__PASSWORD_FILE=secrets/postgres_password # Sessions: JWT signed with a key from a secret file + server-side session row in PostgreSQL # (shared by all API replicas, so no sticky sessions are needed). APP_CONFIG__JWT__SECRET_FILE=secrets/jwt_secret APP_CONFIG__JWT__SESSION_TTL_SECONDS=3600 # Idempotency-Key: a repeat within this window returns the original message (contract: 24 h). APP_CONFIG__IDEMPOTENCY__TTL_SECONDS=86400 # Graceful shutdown: after SIGTERM /health/ready answers 503 for DRAIN seconds, then the port closes # and in-flight requests get GRACEFUL seconds. DRAIN must exceed the LB detection time (fall*inter + check timeout = 2.5 s). APP_CONFIG__RUN__DRAIN_SECONDS=3 APP_CONFIG__RUN__GRACEFUL_TIMEOUT=5 # Used by compose.yaml. # Host port for PostgreSQL (bound to 127.0.0.1 only); API replicas publish no ports at all. POSTGRES_HOST_PORT=5432 # Number of API replicas behind the load balancer. API_REPLICAS=2 # S3 (MinIO). Values below are for running the API or scripts from the venv on the host; # inside Compose the API uses http://minio:9000 and the s3_* Docker secrets. APP_CONFIG__S3__ENDPOINT=http://127.0.0.1:9000 APP_CONFIG__S3__REGION=us-east-1 APP_CONFIG__S3__BUCKET=messenger-attachments APP_CONFIG__S3__ACCESS_KEY_FILE=secrets/s3_access_key_id APP_CONFIG__S3__SECRET_KEY_FILE=secrets/s3_secret_access_key # Used by compose.yaml: bucket name and host port of MinIO (bound to 127.0.0.1 only). S3_BUCKET=messenger-attachments MINIO_HOST_PORT=9000