Updated to just use DATABASE_* in everything other than local docker.
This commit is contained in:
Stefan Lazic committed 2026-08-07 17:30:12 +01:00
1 parent 769d3f9ebc
commit 51de4f4ef5
19 files changed
+120 -56

No files matched your search

+14 -9
View File
@@ -26,18 +26,23 @@ FROM node:22-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# DATABASE_URL isn't needed to generate the client (no DB connection at
# generate time) — only real values needed at runtime, never baked in here.
# These database env vars aren't needed to generate the client (no DB
# connection at generate time) — only real values needed at runtime, never
# baked in here.
RUN npx prisma generate
# `next build`'s page-data collection step imports every route module
# (including /api/health) to inspect it — that pulls in
# src/lib/db/prisma.ts, which requires DATABASE_URL just to construct its
# connection-pool config object, even though nothing actually connects at
# build time. This placeholder only exists to satisfy that check; the
# real value is supplied at container runtime via env_file (see
# docker-compose.local.yaml) and this one is never used to connect to
# anything or baked into a layer that matters.
ENV DATABASE_URL="mysql://build:build@localhost:3306/build"
# src/lib/db/prisma.ts, which requires DATABASE_HOST/NAME/USER/PASSWORD
# just to construct its connection-pool config object, even though nothing
# actually connects at build time. These placeholders only exist to
# satisfy that check; the real values are supplied at container runtime
# via env_file (see docker-compose.local.yaml) and these are never used to
# connect to anything or baked into a layer that matters.
ENV DATABASE_HOST="localhost"
ENV DATABASE_PORT="3306"
ENV DATABASE_NAME="build"
ENV DATABASE_USER="build"
ENV DATABASE_PASSWORD="build"
RUN npm run build
FROM node:22-alpine AS runner