fix: RAILWAY_PUBLIC_DOMAIN envvar not resolving, add fallback & warning, change Dockerfile interpolation

This commit is contained in:
2025-08-20 16:44:53 -05:00
parent d0b17fdc94
commit 8431290ea7
2 changed files with 12 additions and 5 deletions

View File

@@ -5,6 +5,16 @@ import sitemap from "@astrojs/sitemap";
import react from "@astrojs/react";
// Log warning if RAILWAY_PUBLIC_DOMAIN is not set in production
if (
process.env.NODE_ENV === "production" &&
!process.env.RAILWAY_PUBLIC_DOMAIN
) {
console.warn(
"⚠️ RAILWAY_PUBLIC_DOMAIN not set in production mode. Falling back to https://dynamic-preauth.xevion.dev"
);
}
// TODO: Add linting to build steps
// https://astro.build/config
@@ -17,10 +27,7 @@ export default defineConfig({
process.env.NODE_ENV === "development"
? "https://localhost:4321"
: `https://${
process.env.RAILWAY_PUBLIC_DOMAIN ??
(() => {
throw new Error("RAILWAY_PUBLIC_DOMAIN not set");
})()
process.env.RAILWAY_PUBLIC_DOMAIN || "dynamic-preauth.xevion.dev"
}`,
integrations: [
tailwind(),