Settings
Every setting the dashboard reads, its default, the port, and how to change them with Docker and without.
The settings
Every setting is optional: the dashboard runs without any of them.
| Variable | Default | What it does |
|---|---|---|
NEXT_PUBLIC_DEMO_MODE | false | true shows the demo sign-in details on the sign-in page, fills them in, and shows a floating colour switcher. Leave it off for your own product. |
BUILD_STANDALONE | empty | true builds a self-contained server into .next/standalone. The Dockerfile sets it for you. Leave it empty for yarn start. |
The port
The dashboard answers on port 3030. It is not a variable: the dev and start scripts in package.json pass -p 3030, and the Docker image sets PORT=3030. To use another port for one run:
| How you run it | On port 3041 |
|---|---|
| Docker | docker run -p 3041:3030 financial-dashboard, changing only the number on the left of -p |
| Development server | yarn dev -p 3041 |
| Production build | yarn start -p 3041 |
Without Docker
Copy .env.example to .env.local and edit the values there. Keep .env.example as it is, as the list of what exists.
dashboard-template-1cp .env.example .env.localNEXT_PUBLIC_DEMO_MODE=trueWith Docker
The image build does not read .env or .env.local files. Pass each value as a build argument instead:
dashboard-template-1docker build -t financial-dashboard --build-arg NEXT_PUBLIC_DEMO_MODE=true .When a change takes effect
Values that start with NEXT_PUBLIC_ are compiled into the JavaScript the browser loads when the app is built. Changing one changes nothing until the app is built again:
| How you run it | After changing a value |
|---|---|
yarn dev | Stop the server and run yarn dev again. |
yarn build and yarn start | Run yarn build again, then yarn start. |
| Docker | Build the image again with the value as a --build-arg, then start a new container. |
| Vercel | Change it in the project's Environment Variables and deploy again. |
Never put a secret in a NEXT_PUBLIC_ value: every visitor can read it in the page's code. Keys for your own services belong on your server.
The standalone build
With BUILD_STANDALONE=true, yarn build writes a server that needs no node_modules into .next/standalone. The Dockerfile uses it to keep the image small. yarn start is not meant for that kind of build and warns "next start" does not work with "output: standalone" configuration. Leave the variable empty unless you copy the standalone folder to a server yourself.