1234567891011121314151617181920212223242526 |
- FROM node:16-alpine as build-stage
- MAINTAINER Adoin 'adoin@qq.com'
- WORKDIR /app
- COPY . ./
- RUN npm config set registry https://registry.npm.taobao.org
- ENV NODE_OPTIONS=--max-old-space-size=16384
- RUN npm install pnpm -g && \
- pnpm install --frozen-lockfile && \
- pnpm build:docker
- RUN echo "🎉 编 🎉 译 🎉 成 🎉 功 🎉"
- FROM nginx:1.23.3-alpine as production-stage
- COPY --from=build-stage /app/dist /usr/share/nginx/html/dist
- COPY --from=build-stage /app/nginx.conf /etc/nginx/nginx.conf
- EXPOSE 80
- CMD sed -i "s|__vg_base_url|$VG_BASE_URL|g" /usr/share/nginx/html/dist/assets/index.js && \
- sed -i "s|__vg_base_url|$VG_BASE_URL|g" /usr/share/nginx/html/dist/_app.config.js && \
- nginx -g 'daemon off;'
- RUN echo "🎉 架 🎉 设 🎉 成 🎉 功 🎉"
|