From 3d7cc67dfcc5053404de1328cd0d1c5fd20a5dde Mon Sep 17 00:00:00 2001 From: Chong WU Date: Tue, 25 Jun 2019 09:47:29 +0800 Subject: [PATCH] modify docker-hub:build (#4596) --- Dockerfile.hub | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile.hub b/Dockerfile.hub index 2e9c1ec9..43d89815 100644 --- a/Dockerfile.hub +++ b/Dockerfile.hub @@ -1,10 +1,24 @@ -FROM nginx +FROM circleci/node:latest-browsers as builder WORKDIR /usr/src/app/ +USER root +COPY package.json ./ +RUN yarn + +COPY ./ ./ + +RUN npm run test:all + +RUN npm run build + + +FROM nginx + +WORKDIR /usr/share/nginx/html/ COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf -COPY ./dist /usr/share/nginx/html/ +COPY --from=builder /usr/src/app/dist /usr/share/nginx/html/ EXPOSE 80 -- GitLab