JanetFrontEnd/Dockerfile

33 lines
484 B
Docker

FROM node:16-alpine as build
WORKDIR /app
COPY package.json .
COPY package-lock.json .
RUN npm install react-router-dom
RUN npm install
RUN rm -fr /root/.cache/*
COPY ./src ./src
COPY ./public ./public
ARG version_info
ENV REACT_APP_VERSION_INFO=${version_info}
RUN npm run build
COPY . .
#CMD ["npm", "start"]
RUN rm -fr /root/.cache/*
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx.default.conf /etc/nginx/conf.d/default.conf