# Single-stage build + run. node:24-slim gives stable node:sqlite (no flag) for # the .data/store.db login store. We build the client (vite → dist/client) and # bundle the server (esbuild → dist/server/index.js), then run the bundle with # the full node_modules present (the bundle keeps prod deps external). FROM node:24-slim WORKDIR /app RUN corepack enable # .npmrc (node-linker=hoisted) must be present at install time so transitive deps # the server bundle keeps external resolve at runtime — copy it before installing. COPY package.json pnpm-lock.yaml .npmrc ./ RUN pnpm install --frozen-lockfile COPY . . RUN pnpm build ENV NODE_ENV=production ENV PORT=8080 EXPOSE 8080 CMD ["node", "dist/server/index.js"]