# Auto-generated by GitBlixt for Node.js apps FROM docker.io/node:22-slim AS deps WORKDIR /app RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates \ && rm -rf /var/lib/apt/lists/* COPY package*.json ./ RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi # --- builder --- FROM deps AS builder COPY . . RUN npm run build --if-present # --- runner --- FROM docker.io/node:22-slim AS final WORKDIR /app RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates dumb-init \ && rm -rf /var/lib/apt/lists/* ENV NODE_ENV=production ENV PORT=4000 COPY --from=builder /app /app EXPOSE ${PORT} CMD ["dumb-init", "npm", "start"]