fix(security): USER node + HEALTHCHECK in production stage (SEC-013/F9/F11)
This commit is contained in:
parent
97c32222ce
commit
7d43bc6b70
1 changed files with 4 additions and 0 deletions
|
|
@ -11,5 +11,9 @@ ENV NODE_ENV=production
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci --legacy-peer-deps --omit=dev
|
RUN npm ci --legacy-peer-deps --omit=dev
|
||||||
COPY --from=build /app/dist ./dist
|
COPY --from=build /app/dist ./dist
|
||||||
|
RUN chown -R node:node /app
|
||||||
|
USER node
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
||||||
|
CMD wget -qO- http://localhost:3001/health || exit 1
|
||||||
CMD ["node", "dist/main"]
|
CMD ["node", "dist/main"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue