diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..57d3105 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/node_modules +/build +/dist \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6336b7b..c7ea6b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,13 @@ +FROM node:lts-slim as builder + +WORKDIR /app + +COPY . /app + +RUN yarn config set registry https://registry.npm.taobao.org && yarn && yarn build + FROM nginx:1.23.4-alpine-slim -COPY dist /usr/share/nginx/html +COPY --from=builder /app/dist /usr/share/nginx/html -COPY docker/nginx.conf /etc/nginx/nginx.conf +COPY --from=builder /app/docker/nginx.conf /etc/nginx/nginx.conf \ No newline at end of file