Files
ogame-vue-ts/Dockerfile
coolxitech 3ed03b5e37 build(docker): 更新pnpm安装命令以解决依赖问题
- 在pnpm install命令中添加--shamefully-hoist参数
- 保持vite构建步骤不变
- 维持nginx基础镜像配置
2025-12-13 12:08:55 +08:00

24 lines
496 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 --shamefully-hoist; 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;"]