Compare commits

...

2 commits

Author SHA1 Message Date
99ce69ec12 Merge pull request 'fix: install production dependencies in runtime image' (#4) from fix/runtime-deps into main
Some checks failed
/ checks (push) Failing after 35s
/ deploy (push) Has been skipped
Reviewed-on: http://forgejo.local:3000/nholtware/demo-app/pulls/4
2026-11-05 01:07:45 -06:00
f6a971b194 fix: install production dependencies in runtime image
All checks were successful
/ checks (pull_request) Successful in 36s
Express was added in 1365bd7 but the runtime stage still assumed zero
runtime deps, so the image crashed with ERR_MODULE_NOT_FOUND: express.
2026-11-05 00:56:45 -06:00

View file

@ -7,14 +7,15 @@ COPY tsconfig.json ./
COPY src ./src
RUN npm run build
# Runtime stage: no dev deps (this service has zero runtime deps)
# 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
COPY package.json ./
USER node
EXPOSE 3000
CMD ["node", "dist/index.js"]