ktvmanager/client/Dockerfile.prod
karl.hudgell d05d37e4f9 latest
2021-03-12 13:56:26 +00:00

18 lines
493 B
Docker

# stage1 - build react app first
FROM node:12-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY ./package.json /app/
COPY ./yarn.lock /app/
RUN yarn
COPY . /app
RUN yarn build
# stage 2 - build the final image and copy the react build files
FROM nginx:1.17.8-alpine
COPY --from=build /app/build /usr/share/nginx/html
RUN apk --no-cache add curl
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d
EXPOSE 6969
CMD ["nginx", "-g", "daemon off;"]