fix(admin-web): add API_GATEWAY_URL env var for Docker build
The Next.js rewrites in next.config.js require API_GATEWAY_URL to be set at build time. Added this environment variable to both Dockerfile and docker-compose.yml to ensure proper routing to Kong gateway in production. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
967e6c1f44
commit
1d7f05b12d
|
|
@ -24,6 +24,8 @@ COPY . .
|
||||||
# 设置环境变量
|
# 设置环境变量
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
# 设置 API 网关地址(构建时需要,用于 next.config.js rewrites)
|
||||||
|
ENV API_GATEWAY_URL=https://rwaapi.szaiai.com
|
||||||
|
|
||||||
# 构建应用
|
# 构建应用
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ services:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- PORT=3100
|
- PORT=3100
|
||||||
- NEXT_TELEMETRY_DISABLED=1
|
- NEXT_TELEMETRY_DISABLED=1
|
||||||
|
- API_GATEWAY_URL=https://rwaapi.szaiai.com
|
||||||
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:3023}
|
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:3023}
|
||||||
- NEXT_PUBLIC_APP_NAME=挖矿管理后台
|
- NEXT_PUBLIC_APP_NAME=挖矿管理后台
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue