Skip to content

Building the image

The Dockerfile has two stages:

  1. frontend-build (node:20-alpine): installs the frontend dependencies and runs vite build.
  2. runtime (node:20-alpine): installs production backend dependencies, copies backend/src and puts the built frontend in ./public. It runs node src/index.js on port 3001.
Terminal window
docker build -t pethealth:dev .
docker run --rm -p 3000:3001 -e JWT_SECRET=dev pethealth:dev

The official image is martitoci/pethealth, built for linux/amd64. From any machine, including Apple Silicon:

Terminal window
docker buildx build --platform linux/amd64 \
-t martitoci/pethealth:latest --push .

To build for other architectures (e.g. a Raspberry Pi), build on that machine or add --platform linux/arm64. better-sqlite3 compiles natively, so cross-building ARM under emulation is slow but works.