Docker
Dockerfiles and docker-compose for frontend and backend.
Backend
Multi-stage Dockerfile:
- Builder:
golang:1.24-bookworm, builds with-ldflags="-w -s"(stripped binary). - Runtime:
debian:bookworm-slim, non-rootappuser(uid 1000),tzdata+ca-certificates,HEALTHCHECKviawget /health, exposes 3001.
docker-compose.yml — two services on a hallo-network bridge:
| Service | Image / build | Notes |
|---|---|---|
db | postgres:18 | tuned postgresql.conf, init.sql mounted, healthcheck pg_isready, 512 MB mem limit |
app | builds from Dockerfile | depends_on: db: condition: service_healthy, all env vars injected, mounts ./build/uploads + app_logs volume, 512 MB / 1 CPU limit, 30s stop grace |
init.sql enables uuid-ossp and creates enum types role_display_type, reminder_status, reminder_type.
Frontend
Multi-stage Dockerfile:
- Builder:
node:24-bookworm, runsnpm run build. Contains asedpatch fixing an ESLint rule reference inAdminEditUserDashboard.jsduring build. - Runtime:
nginx:alpine, serves the static SPA.nginx.conffalls back toindex.htmlfor client-side routing.
docker-compose.yml — builds with production API args, maps 3003:80, logs to json-file (10 MB × 3 files).
These docs
This docs site (hallostroke-docs) is a Next.js 16 app (Fumadocs) with its own Docker setup:
- Builder:
oven/bun:1.3.14forbun install(fast), thennode:24-alpinerunsnpm run build(Next standalone output). - Runtime:
node:24-alpine, non-rootnextjsuser, runs the Next standaloneserver.json port 3000.
services:
docs:
build: .
image: hallostroke-docs
container_name: hallostroke-docs
ports:
- "3000:3000"
restart: unless-stoppedWhy bun for install, node for build?
Bun's installer is faster, but bun run build crashed with a SIGILL on some CPUs (a known Bun bug). Using bun only for bun install --frozen-lockfile and node for the Next build avoids the crash while keeping the fast install.