Skip to main content

Docker

The Shift Platform packages into a single Docker image that runs the Hono gateway with all service APIs in-process.

Quick Start

docker build -t shift-platform:dev .
docker run -p 3000:3000 shift-platform:dev

Then verify with:

curl http://localhost:3000/healthz
# {"status":"ok","service":"shift-gateway"}

Multi-Stage Dockerfile

The Dockerfile uses a multi-stage build for efficient caching and small production images:

Stage 1: deps

Copies all package.json and bun.lock files from the root and every submodule, then runs bun install for the root and each submodule. This layer is cached and only rebuilt when dependency files change.

Stage 2: web-build

Builds 7 Vite web UIs (the platform web UI plus 6 service web UIs). Each service's web assets are compiled into static files that the gateway serves.

Stage 3: production

Creates a slim production image containing only:

  • Runtime dependencies (from the deps stage)
  • Source code (TypeScript, executed directly by Bun)
  • Built web assets (from the web-build stage)

Environment Variables

Pass environment variables at runtime to configure the gateway:

docker run -p 3000:3000 \
-e SHIFT_STORAGE=convex \
-e CONVEX_SELF_HOSTED_URL=http://convex:3210 \
-e NODE_ENV=production \
shift-platform:dev

See the Environment Variables reference for the full list.

Building for Production

The CI pipeline builds and tags images automatically. To build a production-tagged image manually:

docker build -t shift-platform:latest .

Container Registry

Images are published to GCP Artifact Registry:

us-central1-docker.pkg.dev/platform-489018/shift-platform/platform
TagWhen
sha-<commit>Every push to main or stage
latestLatest main branch build

Troubleshooting

BuildKit I/O Error

If Docker build fails with write metadata_v2.db: input/output error, restart Docker Desktop:

killall "Docker Desktop" "com.docker.backend" 2>/dev/null || true
sleep 3
open -a "Docker Desktop"

Then retry the build.