mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
build(docker): 更新Docker构建环境配置
- 使用node:lts-alpine替换node:latest基础镜像 - 添加git安装和npm镜像源配置 - 修改apk软件源为中科大镜像站 - 更新构建命令为pnpm run build格式 - 优化构建阶段依赖安装逻辑
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
FROM node:latest AS builder
|
||||
FROM node:lts-alpine AS builder
|
||||
|
||||
RUN mkdir -p /workspace
|
||||
WORKDIR /workspace
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
||||
RUN apk update && apk add git
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
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;
|
||||
RUN pnpm build
|
||||
RUN pnpm run build
|
||||
|
||||
# --- 第二阶段:Nginx ---
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
Reference in New Issue
Block a user