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