joinpeertube/docker/Dockerfile

35 lines
655 B
Docker

FROM node:13-alpine as build-stage
WORKDIR /app
COPY package.json .
COPY yarn.lock .
RUN apk add python2 make g++
RUN yarn install --pure-lockfile \
&& yarn cache clean
COPY src/ src/
COPY public/ public/
COPY .eslintrc.js .
COPY vue.config.js .
COPY Makefile .
COPY .babelrc .
# TODO: the build works fine with only the above files, does that mean we can delete everything else?
#COPY babel.config.js .
#COPY vue.config.js .
#COPY postcss.config.js .
#COPY .eslintrc .
ENV NODE_ENV=production
RUN yarn run build
FROM nginx as production-stage
RUN mkdir /app
COPY --from=build-stage /app/dist /app
COPY docker/nginx.conf /etc/nginx/nginx.conf