40 lines
692 B
Docker
40 lines
692 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 src /app/src
|
|
#ADD src/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" ]
|