mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-07-30 15:38:59 +02:00
Merge branch 'main' of github.com:suranyami/Shadowbroker
Former-commit-id: 8e9607c7adaf4f1b4b5013fab10429787671ec03
This commit is contained in:
@@ -11,10 +11,6 @@ WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
# NEXT_PUBLIC_* vars must exist at build time for Next.js to inline them.
|
||||
# Default empty = auto-detect from browser hostname at runtime.
|
||||
ARG NEXT_PUBLIC_API_URL=""
|
||||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||
RUN npm run build
|
||||
|
||||
FROM base AS runner
|
||||
|
||||
+4
-12
@@ -1,9 +1,9 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
// BACKEND_URL is a plain (non-NEXT_PUBLIC_) env var read at server startup —
|
||||
// not baked at build time — so it can be set in docker-compose `environment`.
|
||||
// Defaults to localhost for local dev where both services run on the same host.
|
||||
const backendUrl = process.env.BACKEND_URL ?? "http://localhost:8000";
|
||||
// /api/* requests are proxied to the backend by the catch-all route handler at
|
||||
// src/app/api/[...path]/route.ts, which reads BACKEND_URL at request time.
|
||||
// Do NOT add rewrites for /api/* here — next.config is evaluated at build time,
|
||||
// so any URL baked in here ignores the runtime BACKEND_URL env var.
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
transpilePackages: ['react-map-gl', 'mapbox-gl', 'maplibre-gl'],
|
||||
@@ -14,14 +14,6 @@ const nextConfig: NextConfig = {
|
||||
eslint: {
|
||||
ignoreDuringBuilds: true,
|
||||
},
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: "/api/:path*",
|
||||
destination: `${backendUrl}/api/:path*`,
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user