fix: webpack build, low memory limits, and sitemap try/catch for Docker deploy
- Switch both storefronts from Turbopack to Webpack (next build --webpack) - Limit build workers to 1 CPU (experimental.cpus: 1) - Reduce NODE_OPTIONS max-old-space-size from 2048 to 1024 MB - Wrap sitemap.ts API calls in try/catch to prevent build crash when backend is unavailable during Docker build - During build, sitemap returns static paths only; at runtime it fetches full dynamic data
This commit is contained in:
@@ -30,7 +30,7 @@ ENV NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=$NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY
|
||||
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
||||
ENV NEXT_PUBLIC_DEFAULT_REGION=$NEXT_PUBLIC_DEFAULT_REGION
|
||||
ENV NODE_ENV=production
|
||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
||||
ENV NODE_OPTIONS="--max-old-space-size=1024"
|
||||
|
||||
RUN npm run build --workspace=@dtc/suman-hrvatska
|
||||
|
||||
|
||||
Reference in New Issue
Block a user