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.
| Variable | Required | Used for |
|---|---|---|
DB_USER | Yes | Postgres username — used by both the postgres container (to create the role) and the backend's connection pool |
DB_PASSWORD | Yes | Postgres password |
DB_NAME | Yes | Postgres database name |
JWT_SECRET | Yes | Signs/verifies the dashboard's session JWT. Use a long, random value — anyone with this secret can mint valid session tokens |
PORT | Yes | Host port the nginx service publishes; this is the port you access FlagPulse on (e.g. http://localhost:$PORT) |
Notes
- There's no
.envvalue for the backend's internal port — it's hardcoded to3000inserver.jsand innginx.conf'sproxy_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 editbackend/config/postgres.jsandbackend/config/redis.jsdirectly. .envis 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