This commit is contained in:
@@ -15,10 +15,12 @@ ARG CACHEBUST=1
|
||||
COPY . .
|
||||
|
||||
# Production API wiring (baked into the build):
|
||||
# - the browser calls /api on its own origin; nginx forwards that to backend:5000
|
||||
# - the Nuxt server (SSR) reaches the backend container by service name
|
||||
# - the browser calls /api on its own origin (mathew.aranroig.com); nginx
|
||||
# routes that to the backend
|
||||
# - the Nuxt server (SSR) reaches the backend through the same public
|
||||
# address — nginx at mathew.aranroig.com/api — never the container name
|
||||
ENV NUXT_PUBLIC_API_BASE=
|
||||
ENV NUXT_API_PROXY_TARGET=http://backend:5000
|
||||
ENV NUXT_API_PROXY_TARGET=https://mathew.aranroig.com
|
||||
|
||||
# Build the Nuxt app
|
||||
RUN npm run build
|
||||
|
||||
@@ -48,7 +48,8 @@ export default defineNuxtConfig({
|
||||
|
||||
// The Nuxt server's own API calls (SSR) are relative once apiBase is "",
|
||||
// and land on this Nitro route, which forwards them to the backend. The
|
||||
// Docker image bakes NUXT_API_PROXY_TARGET=http://backend:5000 in at build.
|
||||
// Docker image bakes NUXT_API_PROXY_TARGET=https://mathew.aranroig.com in
|
||||
// at build; nginx routes that address on to the backend.
|
||||
routeRules: {
|
||||
'/api/**': { proxy: `${process.env.NUXT_API_PROXY_TARGET || 'http://localhost:5000'}/api/**` },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user