Fix: Pass FASTAPI_URL as build arg for Next.js rewrites
Next.js rewrites are evaluated at build time, not runtime. Without FASTAPI_URL set during build, the rewrite destination defaults to localhost:8000 which fails in Docker. - Add FASTAPI_URL build arg to nextjs-app/Dockerfile - Pass build arg in docker-compose.yml - Pass build arg in Gitea Actions workflow Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,10 @@ COPY . .
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Build argument for FastAPI URL (used by Next.js rewrites at build time)
|
||||
ARG FASTAPI_URL=http://backend:80/api
|
||||
ENV FASTAPI_URL=${FASTAPI_URL}
|
||||
|
||||
# Build application
|
||||
RUN npm run build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user