mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
- 简化多阶段构建结构 - 移除不必要的注释和空行 - 更新基础镜像为node:latest - 调整工作目录创建方式 - 合并git克隆和依赖安装步骤 - 修改构建命令执行顺序 - 清理nginx html目录内容 - 调整文件复制路径逻辑
24 lines
478 B
Docker
24 lines
478 B
Docker
FROM node:latest AS builder
|
|
|
|
RUN mkdir -p /workspace
|
|
|
|
WORKDIR /workspace
|
|
|
|
RUN npm config set registry https://registry.npmmirror.com
|
|
|
|
RUN cd /workspace
|
|
|
|
RUN git clone https://github.com/setube/ogame-vue-ts.git
|
|
|
|
RUN mv ./ogame-vue-ts/* . ; rm -rf ./ogame-vue-ts/
|
|
|
|
RUN npm install -g pnpm ; pnpm install ; npx vite build
|
|
|
|
FROM nginx:alpine
|
|
|
|
RUN rm -rf /usr/share/nginx/html/*
|
|
|
|
COPY --from=builder /workspace/docs /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"] |