react-project/api/Dockerfile

26 lines
542 B
Docker
Raw Permalink Normal View History

2024-02-28 12:42:50 +02:00
ARG NODE_IMAGE="node"
ARG NODE_VERSION="16.17-slim"
FROM ${NODE_IMAGE}:${NODE_VERSION}
ENV TZ=Asia/Jerusalem
WORKDIR /project
COPY package.json package-lock.json /project/
RUN npm ci --no-audit --no-fund
COPY --chown=node:node . /project/
RUN chown node:node /project -R && \
find /project -type d -exec chmod 0750 {} \; && \
find /project -type f -exec chmod 0650 {} \; && \
ls -la /project && \
find /project ! -path '/project/node_modules/*'
# Run as node (user id 1000)
USER node
CMD ["node", "/project/app.js"]