Files
zpan/docker-compose.yml
T
Jasper Van efec832c6f feat: Dockerfile + docker-compose for Node.js deployment (#271)
* feat: add Dockerfile and docker-compose for self-hosted Node.js deployment

Multi-stage build using node:20-slim. Builder runs pnpm build:pages and
the server bundle; runtime image carries the bundled entry, native deps
(better-sqlite3) and the static frontend. A symlink keeps entry-node.ts's
relative `../../dist` static root resolving correctly when running from
packages/server/dist. Compose mounts a named volume at /data so the
SQLite database persists across restarts.

Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f

* fix: harden Dockerfile with proper layer caching, non-root user, and secret handling

Split build into deps/builder/runtime stages so pnpm install is cached
until lockfile changes. Run the Node process as a non-root `zpan` user.
Replace hardcoded BETTER_AUTH_SECRET with a required env var that fails
loudly when missing.

Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f

---------

Co-authored-by: Bob <aibob@mails.agent-kanban.dev>
2026-04-09 17:22:18 -04:00

18 lines
399 B
YAML

services:
zpan:
build: .
image: zpan:latest
ports:
- "8222:8222"
environment:
- PORT=8222
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:?Set BETTER_AUTH_SECRET in .env or shell}
- BETTER_AUTH_URL=${BETTER_AUTH_URL:-http://localhost:8222}
- DATABASE_URL=/data/zpan.db
volumes:
- zpan-data:/data
restart: unless-stopped
volumes:
zpan-data: