This project runs as a single Docker Compose service named dphe-data-api.
Dockerfilebuilds the Node.js API image.docker-compose.ymldefines the Compose service and port mapping..envsets local Compose overrides such asDB_PATHandPORT.docker-compose.envis an optional tracked env file you can pass with--env-file.
The Docker image includes the local test fixture at /app/test/resources/deepphe.sqlite3.
Because the API runs inside the container, DB_PATH must be a container path, not a macOS/Linux host path. These are both valid for the bundled fixture:
DB_PATH=./test/resources/deepphe.sqlite3
DB_PATH=/app/test/resources/deepphe.sqlite3The SQLite client opens the database read/write, so any externally mounted database directory must be writable.
The image also bundles a larger fixture at /app/test/resources/deepphe-500.sqlite3.
To serve it instead of the default, point DB_PATH at it. For example, in .env:
DB_PATH=./test/resources/deepphe-500.sqlite3Or for a single run without editing .env:
DB_PATH=./test/resources/deepphe-500.sqlite3 docker compose up --buildCompose automatically reads .env and uses those values to fill docker-compose.yml. Values in .env override the Docker defaults in Compose.
To run with the bundled test fixture, put this in .env:
DB_PATH=./test/resources/deepphe.sqlite3
PORT=3333Then build and start:
docker compose up --buildOpen:
http://localhost:3333/docsRun in the background:
docker compose up --build -dView logs:
docker compose logs -f dphe-data-apiStop the service:
docker compose downCreate another env file, for example docker-compose.local-db.env:
DB_PATH=/app/db/my_local_database.sqlite3
PORT=3333Files matching docker-compose.*.env are ignored by git, except for the tracked example docker-compose.env.
Start Compose with that env file:
docker compose --env-file ./docker-compose.local-db.env up --buildUsing --env-file replaces Compose's automatic .env file for that run. If you want .env to win, put the final values in .env or pass them directly before the command.
For docker compose up, prefix the command with env vars:
DB_PATH=./test/resources/deepphe.sqlite3 PORT=3333 docker compose up --builddocker compose up does not support a per-service -e DB_PATH=... flag. If you specifically want -e, use docker compose run with --service-ports:
docker compose build
docker compose run --rm --service-ports \
-e DB_PATH=./test/resources/deepphe.sqlite3 \
dphe-data-apiIf a normal Compose container is already running, stop it first so port 3333 is free:
docker compose downIf your database lives outside this repository, mount its directory when using docker compose run:
docker compose build
docker compose run --rm --service-ports \
-v /absolute/host/db-dir:/app/db:rw \
-e DB_PATH=/app/db/deepphe.sqlite3 \
dphe-data-apiReplace /absolute/host/db-dir with the host directory that contains the SQLite database file.
The Docker container listens on port 3333 by default. To expose it on a different Docker port, set PORT in .env or before running Compose:
PORT=4444 docker compose up --buildThen open:
http://localhost:4444/docsShow the resolved Compose configuration:
docker compose configFor a quiet validation check:
docker compose config --quiet