demo-app/Dockerfile
Noah Holt 025c3a8714
All checks were successful
/ checks (push) Successful in 36s
/ deploy (push) Successful in 6s
fix: run dist/bin/server.js in the container
dist/index.js only exports the Express app since the refactor, so the
container exited 0 without listening.
2026-11-05 01:16:54 -06:00

21 lines
477 B
Docker

# Build stage: full toolchain, compile TS -> dist/
FROM node:22 AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
# Runtime stage: production deps only
FROM node:22-slim
WORKDIR /app
ENV NODE_ENV=production
ARG GIT_SHA=dev
ENV GIT_SHA=${GIT_SHA}
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
COPY --from=build /app/dist ./dist
USER node
EXPOSE 3000
CMD ["node", "dist/bin/server.js"]