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",
|
||||
out: "./lib/db/migrations",
|
||||
dbCredentials: {
|
||||
url: env.DATABASE_URL,
|
||||
url: env.DATABASE_URL ?? "",
|
||||
}
|
||||
} satisfies Config;
|
||||
14
lib/env.mjs
14
lib/env.mjs
@ -7,18 +7,10 @@ export const env = createEnv({
|
||||
NODE_ENV: z
|
||||
.enum(["development", "test", "production"])
|
||||
.default("development"),
|
||||
DATABASE_URL: z.string().min(1),
|
||||
DATABASE_URL: z.string().optional(),
|
||||
|
||||
NEXTAUTH_SECRET: process.env.NODE_ENV === "production"
|
||||
? z.string().min(1)
|
||||
: 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()
|
||||
),
|
||||
NEXTAUTH_SECRET: z.string().optional(),
|
||||
NEXTAUTH_URL: z.string().optional(),
|
||||
|
||||
// Azure AD (Microsoft Entra ID) - optional in development
|
||||
AZURE_AD_CLIENT_ID: z.string().optional(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user