This commit is contained in:
1 parent
b9a6f56211
commit
30a47ea236
1 file changed
+9
-3
+9
-3
@@ -6,8 +6,14 @@ RUN corepack enable
|
|||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json pnpm-lock.yaml* ./
|
COPY package.json pnpm-lock.yaml* ./
|
||||||
# DIESE ZEILE HINZUFÜGEN: Erlaubt das Kompilieren von better-sqlite3 und sharp
|
|
||||||
RUN pnpm config set only-built-dependencies --json '["better-sqlite3", "sharp"]'
|
# 1. System-Pakete installieren, die für das Kompilieren von better-sqlite3 nötig sind
|
||||||
|
RUN apk add --no-cache python3 make g++
|
||||||
|
|
||||||
|
# 2. Die erlaubten Build-Abhängigkeiten direkt als pnpm-Umgebungsvariable setzen
|
||||||
|
ENV PNPM_CONFIG_ONLY_BUILT_DEPENDENCIES='["better-sqlite3", "sharp"]'
|
||||||
|
|
||||||
|
# 3. Installation ausführen
|
||||||
RUN pnpm i --frozen-lockfile
|
RUN pnpm i --frozen-lockfile
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
@@ -18,7 +24,7 @@ RUN pnpm run build
|
|||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV=production
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder /app/.next ./.next
|
COPY --from=builder /app/.next ./.next
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
|||||||
Reference in new issue
Block a user