fix: docker build crash when STORAGE_PUBLIC_URL unset

compose.prod.yml passes STORAGE_PUBLIC_URL through ${STORAGE_PUBLIC_URL}
build args/env — when unset in .env.production, docker-compose
substitutes an empty string, not an absent var. ?? only falls back on
null/undefined, so next.config.ts's `new URL("")` threw and failed the
whole `pnpm --filter web build` step. Switched to || in next.config.ts
and lib/storage.ts so empty string also falls back to the default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-12 12:16:11 +02:00
parent 83d18f5ad4
commit 321507b570
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import type { NextConfig } from "next";
const storagePublicUrl = process.env["STORAGE_PUBLIC_URL"] ?? "http://localhost:9000";
const storagePublicUrl = process.env["STORAGE_PUBLIC_URL"] || "http://localhost:9000";
const storageUrl = new URL(storagePublicUrl);
const storageOrigin = storageUrl.origin;