fix: update environment variables in Dockerfile and use config for host in sitemap generation

This commit is contained in:
2025-06-11 17:01:46 +03:30
parent fc33dbf818
commit 261ab28447
2 changed files with 7 additions and 3 deletions
+5
View File
@@ -4,6 +4,11 @@ WORKDIR /app
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci RUN npm ci
COPY . . 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 RUN npm run build
# Production stage # Production stage
+2 -3
View File
@@ -3,8 +3,7 @@
// app/(api)/sitemap/route.ts // app/(api)/sitemap/route.ts
import { NextResponse } from 'next/server'; import { NextResponse } from 'next/server';
import { productCategoriesData } from '../product_categories/data'; import { productCategoriesData } from '../product_categories/data';
import { host } from '@/config';
const HOST = 'http://localhost:3000';
const pages = [ const pages = [
'/', '/',
@@ -30,7 +29,7 @@ export async function GET() {
const loc = `/${locale}`; const loc = `/${locale}`;
return ` return `
<url> <url>
<loc>${HOST}${loc}${page}</loc> <loc>${host}${loc}${page}</loc>
<changefreq>weekly</changefreq> <changefreq>weekly</changefreq>
<priority>0.8</priority> <priority>0.8</priority>
</url> </url>