Add back chown flags in runtime stage

This commit is contained in:
Maciej Pędzich 2024-07-22 09:25:14 +02:00
parent 0f72ee76b8
commit a6a6f51d00
Signed by: maciejpedzich
GPG Key ID: CE4A303D84882F0D

View File

@ -9,8 +9,8 @@ FROM node:lts-alpine AS runtime
WORKDIR /app WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
USER node USER node
COPY package*.json ./ COPY --chown=node:node package*.json ./
RUN npm ci --omit=dev RUN npm ci --omit=dev
COPY --from=build /app/dist ./dist COPY --from=build --chown=node:node /app/dist ./dist
EXPOSE 3000 EXPOSE 3000
CMD ["node", "./dist/index.js"] CMD ["node", "./dist/index.js"]