2024-04-17 07:57:30 -04:00
|
|
|
# pull official base image
|
2024-05-03 17:28:45 -04:00
|
|
|
FROM node:22-alpine AS build
|
2024-04-17 07:57:30 -04:00
|
|
|
|
|
|
|
# set working directory
|
2024-05-03 17:28:45 -04:00
|
|
|
WORKDIR /app
|
2024-04-17 07:57:30 -04:00
|
|
|
|
2024-05-03 17:28:45 -04:00
|
|
|
ENV PATH /app/node_modules/.bin:$PATH
|
|
|
|
ENV NODE_ENV development
|
2024-04-17 07:57:30 -04:00
|
|
|
|
|
|
|
# install and cache app dependencies
|
2024-05-03 17:28:45 -04:00
|
|
|
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/
|
|
|
|
|
2024-04-17 07:57:30 -04:00
|
|
|
RUN npm ci
|
|
|
|
RUN npm install react-scripts@5.0.1 -g --silent
|
|
|
|
|
2024-05-03 17:28:45 -04:00
|
|
|
ADD . /app/
|
|
|
|
COPY --from=build /app/public /app/public
|
|
|
|
#VOLUME /app/data
|
|
|
|
|
|
|
|
USER node
|
|
|
|
|
2024-04-17 07:57:30 -04:00
|
|
|
# start app
|
2024-05-03 17:28:45 -04:00
|
|
|
CMD [ "npm", "start" ]
|