Fix: Add API_INTERNAL_URL to Dockerfile build stage
Next.js rewrites are evaluated at build time, not runtime. The API_INTERNAL_URL was set in K8s deployment but not during the Docker build, causing fallback to localhost:5001. - Added ENV API_INTERNAL_URL=http://workclub-api:8080 - This ensures Next.js rewrites point to internal K8s service
This commit is contained in:
@@ -16,6 +16,8 @@ COPY . .
|
|||||||
# Set environment for build to ensure server binds to all interfaces
|
# Set environment for build to ensure server binds to all interfaces
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
ENV PORT="3000"
|
ENV PORT="3000"
|
||||||
|
# Set API_INTERNAL_URL for build-time Next.js rewrites evaluation
|
||||||
|
ENV API_INTERNAL_URL="http://workclub-api:8080"
|
||||||
RUN bun run build
|
RUN bun run build
|
||||||
|
|
||||||
# Stage 3: Runtime
|
# Stage 3: Runtime
|
||||||
|
|||||||
Reference in New Issue
Block a user