Merge pull request 'fix: install production dependencies in runtime image' (#4) from fix/runtime-deps into main
Reviewed-on: http://forgejo.local:3000/nholtware/demo-app/pulls/4
This commit is contained in:
commit
99ce69ec12
1 changed files with 3 additions and 2 deletions
|
|
@ -7,14 +7,15 @@ COPY tsconfig.json ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Runtime stage: no dev deps (this service has zero runtime deps)
|
# Runtime stage: production deps only
|
||||||
FROM node:22-slim
|
FROM node:22-slim
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ARG GIT_SHA=dev
|
ARG GIT_SHA=dev
|
||||||
ENV GIT_SHA=${GIT_SHA}
|
ENV GIT_SHA=${GIT_SHA}
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci --omit=dev
|
||||||
COPY --from=build /app/dist ./dist
|
COPY --from=build /app/dist ./dist
|
||||||
COPY package.json ./
|
|
||||||
USER node
|
USER node
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["node", "dist/index.js"]
|
CMD ["node", "dist/index.js"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue