Skip to content
Snippets Groups Projects
Commit dde177c1 authored by Lukáš Kratochvíl's avatar Lukáš Kratochvíl
Browse files

feat: client Dockerfile - added USER instruction so we do not run under the...

feat: client Dockerfile - added USER instruction so we do not run under the root user, added TODO comment
parent 41216d15
No related branches found
No related tags found
No related merge requests found
FROM node:16-alpine
#---------- DEVELOPMENT ----------
FROM node:16-alpine AS development
# we do not want to run under the root user
USER node
# install node_modules outside app root in container so local development won't run into a problem of bind-mounting over it with local source code
WORKDIR /usr/src
COPY ["package.json", "package-lock.json", "./"]
COPY --chown=node:node ["package.json", "package-lock.json", "./"]
RUN npm install
# ensures that exactly these executables (from the node_modules folder) are used instead of any other executables which might also be installed on the system inside the Docker image
ENV PATH=/usr/src/node_modules/.bin:$PATH
WORKDIR /usr/src/app
COPY . .
COPY --chown=node:node . .
CMD ["npm", "run", "dev"]
# TODO: add stage to create image for the production environment
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment