# ============================================================================= # beenvoice-web — environment template # ============================================================================= # # Quick start (local dev): # cp .env.example .env.local # docker compose -f docker-compose.dev.yml up -d # bun run db:push # or: bun run db:migrate # bun run dev # # Quick start (Docker app + Postgres): # cp .env.example .env # # edit AUTH_SECRET + public URLs below # docker compose up -d --build # # ----------------------------------------------------------------------------- # Build-time vs runtime (Docker) # ----------------------------------------------------------------------------- # # Baked into the image at `docker compose build` (rebuild after changes): # NEXT_PUBLIC_APP_URL # NEXT_PUBLIC_* branding / theme defaults # NEXT_PUBLIC_AUTHENTIK_ENABLED # NEXT_PUBLIC_UMAMI_* # # Read from .env when the container starts (restart app after changes): # AUTH_SECRET, BETTER_AUTH_URL, DATABASE_URL (compose overrides host), # RESEND_*, DISABLE_SIGNUPS, AUTHENTIK_* secrets, CRON_SECRET # # `NEXT_PUBLIC_APP_URL` should still match your public browser URL for SSR, # emails, and MCP links. In the browser, sign-in uses the current page origin # automatically so dev works when Next picks another port (e.g. 3002). # # Updating production: git pull && docker compose up -d --build # Migrations run on every app start (idempotent — only pending SQL is applied). # ============================================================================= # Core — required # ============================================================================= # PostgreSQL connection string. # Local dev (docker-compose.dev.yml): host is localhost DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres # Session signing secret. Required in production. # Generate: openssl rand -base64 32 AUTH_SECRET=change-me-generate-a-real-secret # Public URL users open in the browser (scheme + host + port if non-standard). # Must match how you access the app for cookies, OAuth callbacks, and email links. BETTER_AUTH_URL=http://localhost:3000 # Same as BETTER_AUTH_URL in most setups. Embedded in the client bundle at build. NEXT_PUBLIC_APP_URL=http://localhost:3000 # ============================================================================= # Local development # ============================================================================= NODE_ENV=development # Set true when connecting to local Postgres without SSL (default for compose). DB_DISABLE_SSL=true # Dev-only: host port for `docker compose -f docker-compose.dev.yml` Postgres. POSTGRES_PORT=5432 # Optional: if Next dev picks another port, you do not need to change URLs for # sign-in — the auth client uses window.location.origin in the browser. # ============================================================================= # Docker Compose (app + database) # ============================================================================= # Host port mapped to container :3000 (WEB_PORT, then PORT, then 3000). WEB_PORT=3000 # Postgres credentials for docker-compose.yml `db` service. # DATABASE_URL inside the app container is set by compose (host `db`, not localhost). POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=postgres # ============================================================================= # White-label defaults (optional) # ============================================================================= # Baked in at Docker build. After first deploy, admins can override many of # Optional white-label defaults (build-time). Users choose light/dark in Settings. NEXT_PUBLIC_BRAND_NAME=beenvoice NEXT_PUBLIC_BRAND_TAGLINE=Simple and efficient invoicing for freelancers and small businesses NEXT_PUBLIC_BRAND_LOGO_TEXT=beenvoice NEXT_PUBLIC_BRAND_ICON=$ # ============================================================================= # Email — Resend (optional) # ============================================================================= # Leave blank to disable invoice and password-reset email delivery. RESEND_API_KEY= RESEND_DOMAIN= # ============================================================================= # Analytics — Umami (optional) # ============================================================================= # Leave website ID blank to disable. NEXT_PUBLIC_UMAMI_WEBSITE_ID= NEXT_PUBLIC_UMAMI_SCRIPT_URL=https://analytics.umami.is/script.js # ============================================================================= # Access control (optional) # ============================================================================= # Block new email/password registrations. Use literal true or false. # DISABLE_SIGNUPS=true # Bearer token for POST /api/cron/generate-recurring (recurring invoice cron). # CRON_SECRET= # ============================================================================= # SSO — Authentik OIDC (optional) # ============================================================================= # Set NEXT_PUBLIC_AUTHENTIK_ENABLED=true and rebuild the image to show SSO on # sign-in. Server secrets are runtime-only (no rebuild needed for secrets). NEXT_PUBLIC_AUTHENTIK_ENABLED=false AUTHENTIK_ISSUER= AUTHENTIK_CLIENT_ID= AUTHENTIK_CLIENT_SECRET= # Optional extra trusted origin for better-auth (defaults derived from issuer). AUTHENTIK_ORIGIN= # ============================================================================= # Advanced / CI (usually unset) # ============================================================================= # Skip Zod env validation during `next build` (set automatically in Dockerfile). # SKIP_ENV_VALIDATION=1