This project uses the top-level Makefile as the main entry point for building, running, and maintaining the dashboard.
Install the following tools:
- Docker
- Docker Compose provider
- GNU Make
Clone the repository and move to its root:
git clone git@github.com:iterorganization/SimDB-Dashboard.git
cd SimDB-DashboardTo see all available commands:
make helpFor host-level service management, use the systemd-oriented compose override.
sudo make systemd-install
sudo make systemd-enable
sudo make systemd-start
sudo make systemd-statussystemd-install copies files to /opt/simdb-dashboard and /etc/simdb-dashboard, installs the unit file to /etc/systemd/system/simdb-dashboard.service, and creates /etc/simdb-dashboard/simdb-dashboard.env from .env.example if it does not exist yet.
Note that there is no need to build the docker image. See the SIMDB_DASHBOARD_IMAGE in simdb-dashboard.env.
If needed, removing the service is accordingly:
sudo make systemd-stop
sudo make systemd-disable
sudo make systemd-uninstall # will prompt before deletionNote that the make systemd-* targets are all effectively systemctl commands, except for the make systemd-install and -uninstall targets.
First provide TLS certificates in docker/nginx/tls/server.pem and docker/nginx/tls/server.key, or generate them with make -C scripts/certs install.
Then install as above (HTTP).
Then modify the compose chain in /etc/simdb-dashboard/simdb-dashboard.env to include the
https compose overlay:
COMPOSE_FILE=docker-compose.yml:docker-compose.https.yml:docker-compose.systemd.ymlFinally enable/start as usual:
sudo make systemd-enable
sudo make systemd-start/etc/simdb-dashboard/simdb-dashboard.env values are passed to docker compose.
COMPOSE_FILE: default systemd stack isdocker-compose.yml:docker-compose.systemd.yml.SIMDB_DASHBOARD_IMAGE: optional image repository override (defaultghcr.io/iterorganization/simdb-dashboard).SIMDB_DASHBOARD_TAG: optional image tag (defaultlatestindocker-compose.systemd.yml; see Published image tags).SYSTEMD_CONTAINER_NAME: optional docker container name override (seedocker-compose.systemd.yml).DASHBOARD_PORT: host HTTP port (default80).DASHBOARD_HTTPS_PORT: host HTTPS port (default443).API_HOST: SimDB backend host (defaulthost.docker.internal).API_PORT: SimDB backend port (default5000).SIMDB_SERVER_URL: browser-side API base path (default/scenarios/api).
See scripts/simdb-dashboard.env.example and scripts/simdb-dashboard.service
for the same defaults and where they are consumed.
CI publishes ghcr.io/iterorganization/simdb-dashboard docker images on every
push to develop or main, and on tagged commits (releases):
| Tag | Pushed on | Mutable |
|---|---|---|
<version> |
develop and tag pushes |
no |
develop |
develop pushes |
yes |
latest |
main pushes |
yes |
<version> is git describe --tags --always at the pushed commit (e.g. 0.9.0 on a
tag, 0.9.0-12-gabc1234 otherwise). The versioned image is therefore treated as
immutable and never reused across events.
Deploy latest (the default, "stable") or pin a version for reproducibility.
For building and running docker containers directly (without need for systemd or root), also for development or tweaking.
From the repository root:
- Build the production service image:
make service- Start the dashboard container:
make up-
Open the dashboard: http://localhost:80/dashboard/
-
Stop the service when needed:
make downThe repository also includes an HTTPS-specific Docker stage and a Compose override in docker-compose.https.yml.
-
Provide TLS certificate files at
docker/nginx/tls/server.pemanddocker/nginx/tls/server.key.If you don't have such certificates yet, see the Makefile helper in
scripts/certsto generate them. -
Build the HTTPS service image:
USE_HTTPS=1 make service- Start the dashboard with the HTTPS override:
USE_HTTPS=1 make up- Open the dashboard:
- HTTP: http://localhost:80/dashboard/ (redirects to https)
- HTTPS: https://localhost:443/dashboard/
- Stop the HTTPS service when needed:
USE_HTTPS=1 make downDid something change in the docker-compose.yml, docker-compose.https.yml, or docker/* files? Stop the service, and restart service (rebuild not necessary):
make down upChanged something in the dashboard/* sources? (e.g. after a git pull.) Stop the service, rebuild the service image (dependencies are cached) and restart:
make down service upNotes:
- Requests under
/scenarios/api/are proxied by nginx to a simdb server expected atAPI_HOST:API_PORT(defaults tohost.docker.internal:5000). nginx sendsX-Forwarded-Prefix: /scenarios/api; SimDB should trust respect header (ProxyFix(..., x_prefix=1)) so absolute URLs it returns retain the public prefix. - You can start multiple dashboards if you change the host port with
DASHBOARD_PORT. - The HTTPS compose override also publishes
DASHBOARD_HTTPS_PORT(default443) and switchesSERVER_CONFtoserver-https.conf. docker-compose.https.ymlreuses the basedocker-compose.yml; environment variables from the base file are inherited, and override entries only add new variables or replace matching keys such asSERVER_CONF.- For non-systemd operations, set
USE_HTTPS=1to switch shared Make targets such asup,down,logs-f, andshellto the HTTPS compose chain. - The
USE_HTTPS=1flag expects TLS certificate files atdocker/nginx/tls/server.pemanddocker/nginx/tls/server.key. If you do not have certificate files yet, a CA-signed key pair can be generated with the provided Makefile atcerts(see the HTTPS installation workflow section for details). - The SimDB proxy location sets
client_max_body_size 2M;andclient_body_buffer_size 2M;to avoid request-body failures (HTTP 413) for larger payloads. If your traffic requires larger uploads, increase both values indocker/nginx/templates/snippets/location-simdb_proxy.conf.template. - Use
PUBLIC_SIMDB_URLor editdocker/nginx/templates/snippets/runtime-config-template.jsfor adjusting the simdb server:
DASHBOARD_PORT=8080 make up
DASHBOARD_PORT=8081 API_PORT=5001 make up
DASHBOARD_PORT=8082 API_HOST=172.20.0.1 API_PORT=5001 make up
DASHBOARD_PORT=8080 DASHBOARD_HTTPS_PORT=8443 USE_HTTPS=1 make up
PUBLIC_SIMDB_URL=https://simdb.iter.org/scenarios/api make up- Additional conveniences are:
make list-all # list all running dashboard containers
DASHBOARD_PORT=8081 make list # list container for the selected container
DASHBOARD_PORT=8081 make logs-f # follow compose logs for the selected container
DASHBOARD_PORT=8081 make shell # open sh inside running dashboard container
DASHBOARD_PORT=8081 USE_HTTPS=1 make logs-f # follow HTTPS compose logs
DASHBOARD_PORT=8081 USE_HTTPS=1 make shell # open sh inside HTTPS containerIf you want to deploy static files to an existing nginx host:
- Build and export frontend artifacts:
make distThis creates dist/ at the repository root containing the built app.
- Copy artifacts to your web root (example path):
sudo cp -r dist/* /www/data/With the Dockerfile defaults, assets are served under /dashboard, so the final
index path should be /www/data/dashboard/index.html.
If you want a portable Docker image tar — for example to move the image to a host that cannot pull from the registry — use:
make simdb-dashboard-service.tarThis creates simdb-dashboard-service.tar at the repository root.
Load and run it on a target machine:
docker load -i simdb-dashboard-service.tar
docker run --rm -p 8080:80 --add-host host.docker.internal:host-gateway simdb-dashboard:serviceUse a location block that falls back to the SPA entry point:
root /www/data;
location /dashboard {
try_files $uri $uri.html /dashboard/index.html;
}This is required for client-side routes under /dashboard/*.
Use Makefile targets for quality checks and updates:
make build # build image for lint/type-check/test
make lint # run lint checks against the build image
make type-check # run TypeScript type checks against the build image
make test # run unit tests against the build image
make update-base # rebuild service image pulling latest base images
make update-deps # refresh package-lock and apply npm audit fixes
make distclean # remove local images/artifacts and compose runtime state