net/rfront/Dockerfile
2024-05-04 02:09:53 +03:00

40 lines
698 B
Docker

# pull official base image
FROM node:22-alpine AS build
# set working directory
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
ENV NODE_ENV development
# install and cache app dependencies
ADD package.json /app
ADD package-lock.json /app
RUN npm ci
ADD front /app/front
#ADD front/config.js /app/src/config.js
ADD public /app/public
ADD ["webpack.config.js", ".babelrc", "/app/"]
RUN npm run build
# pull official base image
FROM node:22-alpine
# set working directory
WORKDIR /app
ADD package*.json /app/
RUN npm ci
RUN npm install react-scripts@5.0.1 -g --silent
ADD . /app/
COPY --from=build /app/public /app/public
#VOLUME /app/data
USER node
# start app
CMD [ "npm", "start" ]