🎨添加静态打包
Some checks failed
continuous-integration/drone/tag Build is failing

This commit is contained in:
coward
2024-08-21 09:10:01 +08:00
parent 941b8da804
commit 12e551b4e9
135 changed files with 15749 additions and 3 deletions

22
web/Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
# 打包前端
FROM node:18-alpine as build-stage
WORKDIR front
COPY . .
WORKDIR web
RUN corepack enable
RUN corepack prepare pnpm@8.6.10 --activate
RUN npm config set registry https://registry.npmmirror.com
RUN pnpm install
RUN pnpm run build
# 前端集成打包
FROM nginx:alpine
WORKDIR /data
# 替换掉Nginx默认配置
RUN rm /etc/nginx/conf.d/default.conf
COPY --from=build-stage /front/docker/web.conf /etc/nginx/conf.d/default.conf
COPY --from=build-stage /front/dist/ ./
# 复制编译后的文件到容器内
RUN /bin/sh -c 'echo init ok'