Skip to content

Environment Variables

All variables are set in a single .env file at the repo root, read by docker-compose.yml and passed through to the backend service.

VariableRequiredUsed for
DB_USERYesPostgres username — used by both the postgres container (to create the role) and the backend's connection pool
DB_PASSWORDYesPostgres password
DB_NAMEYesPostgres database name
JWT_SECRETYesSigns/verifies the dashboard's session JWT. Use a long, random value — anyone with this secret can mint valid session tokens
PORTYesHost port the nginx service publishes; this is the port you access FlagPulse on (e.g. http://localhost:$PORT)

Notes

  • There's no .env value for the backend's internal port — it's hardcoded to 3000 in server.js and in nginx.conf's proxy_pass.
  • Postgres and Redis hostnames are hardcoded to the Compose service names (postgres, redis) rather than being configurable — if you're not using Docker Compose, you'll need to edit backend/config/postgres.js and backend/config/redis.js directly.
  • .env is excluded from Docker build contexts via .dockerignore — never bake secrets into an image layer.

Example .env

bash
DB_USER=flagpulse
DB_PASSWORD=change-me
DB_NAME=flagpulse

JWT_SECRET=replace-with-a-long-random-string

PORT=8080