The frontend ships its own self-contained Docker image (docker/Dockerfile)
that is completely independent of the
rapid-community-data-lab-api backend repo.
At runtime the image's nginx proxies /api/* requests to a backend whose URL
is supplied via the BACKEND_URL environment variable, making the same image
deployable to local Docker Compose, Kubernetes / K3s on OpenStack, and GitLab
CI/CD pipelines without rebuilding.
If Docker container and network have been set up for backend when setting up front end Oni-ui, can skip step 1-2.
-
Docker 24+ and Docker Compose v2
-
The backend repo cloned at
../rapid-community-data-lab-api -
A
configuration.jsonin this directory (copy fromconfiguration.sample.json). Inconfiguration.jsonset the API endpoint to a relative path so requests flow through the nginx proxy:"api": { "rocrate": { "endpoint": "/api", "path": "", "clientId": "am" } }
The frontend container joins a shared external Docker network so that
nginx can resolve the backend by Docker DNS at the hostname api:
docker network create rapid-community-data-labBoth docker/docker-compose.yml (this project) and
../rapid-community-data-lab-api/docker-compose.yml reference this network as
external: true, so no project owns it.
cd ../rapid-community-data-lab-api
docker compose up -d # postgres + opensearch + api
curl -s http://localhost:8080/versioncd ../rapid-cdl-admin
docker compose -f docker/docker-compose.yml up -d --buildThis builds rapid-cdl-admin:local, mounts the host configuration.json at
/configuration.json inside the container, and publishes nginx on host port
8082.
curl -s http://localhost:8082/api/version # proxied to backend
curl -s http://localhost:8082/configuration.json # served from host mount
open http://localhost:8082 # SPA in browserYou should see {"version":"1.0.0"} from the proxied backend call.
docker compose -f docker/docker-compose.yml down
cd ../rapid-community-data-lab-api && docker compose down
# Optional: remove the shared network
docker network rm rapid-community-data-labnpm installnpm run devnpm run buildLint with ESLint
npm run lint