rickvanlieshout.com/Dockerfile.production

22 lines
512 B
Docker
Raw Normal View History

2019-07-19 20:46:06 +02:00
FROM node:alpine as builder
2021-06-21 11:00:43 +02:00
RUN apk update && apk add --no-cache make git python3 autoconf g++ libc6-compat libjpeg-turbo-dev libpng-dev nasm libtool automake vips-dev
2019-07-19 20:46:06 +02:00
WORKDIR /usr/src/app
COPY . .
RUN yarn install
RUN yarn build
RUN rm -rf ./src ./node_modules /usr/local/lib/node_modules /usr/local/share/.cache/yarn/
RUN mkdir -p /run/nginx
FROM nginx:alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /usr/src/app/public /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]