diff --git a/Dockerfile b/Dockerfile index a38c588..51f59eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ WORKDIR /build/astro COPY ./frontend/ ./ ARG RAILWAY_PUBLIC_DOMAIN -ENV RAILWAY_PUBLIC_DOMAIN=$RAILWAY_PUBLIC_DOMAIN +ENV RAILWAY_PUBLIC_DOMAIN=${RAILWAY_PUBLIC_DOMAIN} RUN npm install pnpm -g RUN pnpm install diff --git a/frontend/astro.config.mjs b/frontend/astro.config.mjs index 71ce203..b9e5b83 100644 --- a/frontend/astro.config.mjs +++ b/frontend/astro.config.mjs @@ -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(),