Explorar el Código

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

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
mengboxin137-blip hace 9 horas
padre
commit
e7032f2f3a
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      Dockerfile

+ 2 - 0
Dockerfile

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