2021-09-01 00:20:53 +00:00
|
|
|
FROM node:slim as build
|
|
|
|
|
2021-08-28 21:42:33 +00:00
|
|
|
WORKDIR /app
|
2021-09-01 00:20:53 +00:00
|
|
|
|
2021-08-28 21:42:33 +00:00
|
|
|
ENV PATH /app/node_modules/.bin:$PATH
|
2021-09-01 00:20:53 +00:00
|
|
|
|
2021-08-28 21:42:33 +00:00
|
|
|
COPY package.json ./
|
|
|
|
COPY package-lock.json ./
|
2021-09-01 00:20:53 +00:00
|
|
|
|
|
|
|
RUN npm ci --production && npm cache clean --force
|
2021-08-28 21:42:33 +00:00
|
|
|
COPY . ./
|
2021-09-01 00:20:53 +00:00
|
|
|
RUN npm run build
|
2021-08-28 21:42:33 +00:00
|
|
|
|
2021-09-01 00:20:53 +00:00
|
|
|
FROM nginx:alpine
|
|
|
|
RUN apk -U upgrade
|
2021-08-28 21:42:33 +00:00
|
|
|
COPY --from=build /app/build /usr/share/nginx/html
|
|
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
|
|
|
COPY nginx/nginx.conf /etc/nginx/conf.d
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|