From 261ab28447a5340173d7ce345cf5aca32ccee65b Mon Sep 17 00:00:00 2001 From: ahasani194 Date: Wed, 11 Jun 2025 17:01:46 +0330 Subject: [PATCH] fix: update environment variables in Dockerfile and use config for host in sitemap generation --- Dockerfile | 5 +++++ src/app/api/sitemapBuilder/route.ts | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8463ecd..d6e8acd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,11 @@ WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . + +ENV PORT=5000 +ENV VERCEL_PROJECT_PRODUCTION_URL=http://194.59.214.243:5000 +ENV NEXT_PUBLIC_API_BASE_URL=http://194.59.214.243:5000/api + RUN npm run build # Production stage diff --git a/src/app/api/sitemapBuilder/route.ts b/src/app/api/sitemapBuilder/route.ts index 398bdaf..c71bdd2 100644 --- a/src/app/api/sitemapBuilder/route.ts +++ b/src/app/api/sitemapBuilder/route.ts @@ -3,8 +3,7 @@ // app/(api)/sitemap/route.ts import { NextResponse } from 'next/server'; import { productCategoriesData } from '../product_categories/data'; - -const HOST = 'http://localhost:3000'; +import { host } from '@/config'; const pages = [ '/', @@ -30,7 +29,7 @@ export async function GET() { const loc = `/${locale}`; return ` - ${HOST}${loc}${page} + ${host}${loc}${page} weekly 0.8