Fix ci build by making DATABASE_URL optional during build

This commit is contained in:
Karl Ludwig Weise
2026-04-30 09:17:29 +02:00
parent d57e54e5d0
commit a55b3ded5a
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ ENV NODE_ENV=production
# Copy source and build
COPY . .
RUN npm run build
RUN BUILDING=true npm run build
# Production stage
FROM node:24-alpine AS production
+3 -1
View File
@@ -6,7 +6,9 @@ import { env } from "$env/dynamic/private";
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
import { eq } from "drizzle-orm";
if (!env.DATABASE_URL) throw new Error("DATABASE_URL is not set");
if (!process.env.BUILDING && !env.DATABASE_URL) {
throw new Error("DATABASE_URL is not set");
}
// Central database connection for tenant management
const centralClient = postgres(env.DATABASE_URL);
@@ -11,7 +11,9 @@ import { z } from "zod";
import { ConflictError, NotFoundError, ValidationError } from "../utils/errors";
import { redactDbUrl } from "../utils/url";
if (!env.DATABASE_URL) throw new Error("DATABASE_URL is not set");
if (!process.env.BUILDING && !env.DATABASE_URL) {
throw new Error("DATABASE_URL is not set");
}
const tenantCreationSchema = z.object({
shortName: z