Skip to content

Environment And Services

Last refreshed: 2026-07-22

Source Of Truth

Start from .env.example for host-run configuration. For Compose, copy .env.compose.example to the ignored .env.compose and replace every placeholder. Do not copy secret values into docs, logs, or commits.

After the accepted ANU-7 cutover, .env.compose POSTGRES_DB selects the restored local database used by the containerized CMS. The original Supabase DATABASE_URI remains unchanged in ignored .env as the tested rollback path; do not copy that URI into .env.compose, Markdown, command output, or Git.

Active Environment Keys Observed

Active .env currently includes:

  • BETTER_AUTH_SECRET
  • CRON_SECRET
  • DATABASE_URI
  • ELEVENLABS_API_KEY
  • GOOGLE_GENERATIVE_AI_API_KEY
  • NEXT_PUBLIC_BETTER_AUTH_URL
  • NEXT_PUBLIC_SERVER_URL
  • OPENAI_API_KEY
  • PAYLOAD_DB_PUSH
  • PAYLOAD_SECRET
  • PG_POOL_MAX
  • PREVIEW_SECRET
  • RESEND_API_KEY
  • S3_ACCESS_KEY_ID
  • S3_BUCKET
  • S3_ENDPOINT
  • S3_PRIVATE_BUCKET
  • S3_REGION
  • S3_SECRET_ACCESS_KEY
  • SEED_USER_EMAIL
  • VISUAL_MATCHING_DEBUG_MODE
  • ZOHO_BILLING_ACCESS_TOKEN
  • ZOHO_BILLING_ACCOUNTS_BASE_URL
  • ZOHO_BILLING_API_BASE_URL
  • ZOHO_BILLING_CLIENT_ID
  • ZOHO_BILLING_CLIENT_SECRET
  • ZOHO_BILLING_ORGANIZATION_ID
  • ZOHO_BILLING_REFRESH_TOKEN
  • ZOHO_BILLING_WEBHOOK_SECRET

Compose Environment

.env.compose owns only machine-local stack configuration:

  • POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_PORT
  • PGADMIN_DEFAULT_EMAIL, PGADMIN_DEFAULT_PASSWORD, and PGADMIN_PORT
  • WEB_PORT, PAYLOAD_DB_PUSH, PG_POOL_MAX, and MASTRA_PG_POOL_MAX
  • local Payload, Better Auth, and worker API secrets
  • container-specific overrides such as S3_ENDPOINT=host.docker.internal

Compose reads the optional ignored .env first and .env.compose second. The web, RAG worker, and presentation worker services then override DATABASE_URI with the internal postgres:5432 endpoint. Worker services explicitly disable Payload schema push and wait for the health-gated web initializer. Tracked examples contain placeholders only.

The external render worker API now expects ANUVA_WORKER_API_TOKEN to be defined in environments that serve /api/worker/v1.

Services

  • Local Postgres 17.10 with pgvector 0.8.2: Payload, app data, Mastra storage, and RAG vectors.
  • Local pgAdmin 9.16: browser administration of the local Postgres service.
  • Local web container: Node 22.5.1 development runtime with source hot reload.
  • Local RAG worker container: polls and processes rag_ingestion_jobs.
  • Local presentation worker container: polls and processes presentation_generation_jobs.
  • S3-compatible storage: public/private media and uploads.
  • Worker API auth: bearer token from ANUVA_WORKER_API_TOKEN.
  • Resend: email delivery.
  • OpenAI: text, web search, embeddings, image generation.
  • Google Generative AI: provider key present; verify specific use before depending on it.
  • ElevenLabs: TTS/audio generation.
  • Zoho Billing: plans, customers, credit pack purchases, webhooks, reconciliation.
flowchart TD
  env[".env"] --> next["Next.js runtime"]
  env --> workers["Worker scripts"]
  env --> payload["Payload config"]
  next --> postgres["🗄️ Postgres"]
  next --> storage["🪣 S3 storage"]
  next --> providers["✨ AI providers"]
  next --> email["✉️ Resend"]
  next --> billing["💳 Zoho Billing"]
  workers --> postgres
  workers --> providers
  payload --> postgres

Payload DB Push

PAYLOAD_DB_PUSH=1 enables Payload schema push. The Payload config raises PG_POOL_MAX behavior for push-mode startup to avoid low-pool issues. Use carefully against hosted databases.

The application contains no Supabase-hostname exception. Schema push is controlled only by PAYLOAD_DB_PUSH. Compose defaults it to 1; its web launcher retains that value for an empty machine-local database and changes it to 0 when Payload tables already exist, preventing repeat push on restart. Keep it disabled for databases where reviewed migrations are required, then run pnpm payload migrate against a connection that is authorized to execute DDL.

Local Environment Note

The supported local stack and migration/recovery runbook are documented in LocalDevelopmentStack.md. ANU-7 completed the accepted local cutover with source/target parity, application smoke, persistence, and rollback-connectivity evidence. Future refreshes must repeat the guarded workflow; the presence of a local database alone is not parity evidence.