# syntax=docker/dockerfile:1 # --- build: install everything, check, test, and build the dashboard --------------- FROM node:24-slim AS build WORKDIR /app ENV CI=true RUN corepack enable COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ RUN pnpm install --frozen-lockfile COPY . . RUN pnpm typecheck && pnpm test && pnpm build RUN pnpm prune --prod # --- runtime: Node runs the TypeScript server directly (type stripping) --------------- FROM node:24-slim WORKDIR /app ENV NODE_ENV=production \ PORT=8787 \ DATA_DIR=/data COPY --from=build /app/package.json ./ COPY --from=build /app/node_modules ./node_modules COPY --from=build /app/src ./src COPY --from=build /app/dist ./dist COPY --from=build /app/public ./public # Owned by the node user so a fresh named volume mounted here inherits it. RUN mkdir -p /data && chown node:node /data USER node VOLUME ["/data"] EXPOSE 8787 HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \ CMD node -e "fetch('http://127.0.0.1:8787/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" CMD ["node", "src/server/index.ts"]