cool-admin-vue/Dockerfile

16 lines
427 B
Docker
Raw Normal View History

2021-06-17 15:06:40 +08:00
FROM node:lts-alpine
WORKDIR /build
# 设置Node-Sass的镜像地址
2022-06-27 16:15:05 +08:00
RUN npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
2021-06-17 15:06:40 +08:00
# 设置npm镜像
2022-06-27 16:15:05 +08:00
RUN npm config set registry https://registry.npm.taobao.org
2021-06-17 15:06:40 +08:00
COPY package.json /build/package.json
2022-06-27 16:15:05 +08:00
RUN yarn
2021-06-17 15:06:40 +08:00
COPY ./ /build
RUN npm run build
FROM nginx
RUN mkdir /app
COPY --from=0 /build/dist /app
COPY --from=0 /build/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80