Fix: Make all env vars optional for Docker build time
All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
All checks were successful
Trigger Cloudarix Deploy / call-webhook (push) Successful in 1s
This commit is contained in:
parent
f80c3a1598
commit
477ac67703
@ -6,6 +6,6 @@ export default {
|
|||||||
dialect: "postgresql",
|
dialect: "postgresql",
|
||||||
out: "./lib/db/migrations",
|
out: "./lib/db/migrations",
|
||||||
dbCredentials: {
|
dbCredentials: {
|
||||||
url: env.DATABASE_URL,
|
url: env.DATABASE_URL ?? "",
|
||||||
}
|
}
|
||||||
} satisfies Config;
|
} satisfies Config;
|
||||||
14
lib/env.mjs
14
lib/env.mjs
@ -7,18 +7,10 @@ export const env = createEnv({
|
|||||||
NODE_ENV: z
|
NODE_ENV: z
|
||||||
.enum(["development", "test", "production"])
|
.enum(["development", "test", "production"])
|
||||||
.default("development"),
|
.default("development"),
|
||||||
DATABASE_URL: z.string().min(1),
|
DATABASE_URL: z.string().optional(),
|
||||||
|
|
||||||
NEXTAUTH_SECRET: process.env.NODE_ENV === "production"
|
NEXTAUTH_SECRET: z.string().optional(),
|
||||||
? z.string().min(1)
|
NEXTAUTH_URL: z.string().optional(),
|
||||||
: z.string().optional(),
|
|
||||||
NEXTAUTH_URL: z.preprocess(
|
|
||||||
// This makes Vercel deployments not fail if you don't set NEXTAUTH_URL
|
|
||||||
// Since NextAuth.js automatically uses the VERCEL_URL if present.
|
|
||||||
(str) => process.env.VERCEL_URL ?? str,
|
|
||||||
// VERCEL_URL doesn't include `https` so it cant be validated as a URL
|
|
||||||
process.env.VERCEL_URL ? z.string().min(1) : z.string().url()
|
|
||||||
),
|
|
||||||
|
|
||||||
// Azure AD (Microsoft Entra ID) - optional in development
|
// Azure AD (Microsoft Entra ID) - optional in development
|
||||||
AZURE_AD_CLIENT_ID: z.string().optional(),
|
AZURE_AD_CLIENT_ID: z.string().optional(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user