Forráskód Böngészése

fix: 前端构建时设置 VITE_API_BASE_URL 为空(使用 nginx 反代)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
mengboxin137-blip 11 órája
szülő
commit
e7032f2f3a
1 módosított fájl, 2 hozzáadás és 0 törlés
  1. 2 0
      Dockerfile

+ 2 - 0
Dockerfile

@@ -5,6 +5,7 @@ WORKDIR /app
 COPY frontend/package.json ./
 RUN npm install --registry https://registry.npmmirror.com
 COPY frontend/ .
+ENV VITE_API_BASE_URL=
 RUN npm run build
 
 # 阶段2: 构建管理后台前端
@@ -13,6 +14,7 @@ WORKDIR /app
 COPY admin-frontend/package.json ./
 RUN npm install --registry https://registry.npmmirror.com
 COPY admin-frontend/ .
+ENV VITE_API_BASE_URL=
 RUN npm run build
 
 # 阶段3: Nginx 运行