mirror of
https://github.com/Xevion/dynamic-preauth.git
synced 2025-12-06 05:15:00 -06:00
fix: RAILWAY_PUBLIC_DOMAIN envvar not resolving, add fallback & warning, change Dockerfile interpolation
This commit is contained in:
@@ -34,7 +34,7 @@ WORKDIR /build/astro
|
|||||||
COPY ./frontend/ ./
|
COPY ./frontend/ ./
|
||||||
|
|
||||||
ARG RAILWAY_PUBLIC_DOMAIN
|
ARG RAILWAY_PUBLIC_DOMAIN
|
||||||
ENV RAILWAY_PUBLIC_DOMAIN=$RAILWAY_PUBLIC_DOMAIN
|
ENV RAILWAY_PUBLIC_DOMAIN=${RAILWAY_PUBLIC_DOMAIN}
|
||||||
|
|
||||||
RUN npm install pnpm -g
|
RUN npm install pnpm -g
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
|
|||||||
@@ -5,6 +5,16 @@ import sitemap from "@astrojs/sitemap";
|
|||||||
|
|
||||||
import react from "@astrojs/react";
|
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
|
// TODO: Add linting to build steps
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
@@ -17,10 +27,7 @@ export default defineConfig({
|
|||||||
process.env.NODE_ENV === "development"
|
process.env.NODE_ENV === "development"
|
||||||
? "https://localhost:4321"
|
? "https://localhost:4321"
|
||||||
: `https://${
|
: `https://${
|
||||||
process.env.RAILWAY_PUBLIC_DOMAIN ??
|
process.env.RAILWAY_PUBLIC_DOMAIN || "dynamic-preauth.xevion.dev"
|
||||||
(() => {
|
|
||||||
throw new Error("RAILWAY_PUBLIC_DOMAIN not set");
|
|
||||||
})()
|
|
||||||
}`,
|
}`,
|
||||||
integrations: [
|
integrations: [
|
||||||
tailwind(),
|
tailwind(),
|
||||||
|
|||||||
Reference in New Issue
Block a user