This commit is contained in:
+8
-5
@@ -3,12 +3,15 @@ WORKDIR /app
|
||||
|
||||
RUN npm install -g pnpm@10.26.1
|
||||
|
||||
# 1. Zuerst ALLE Projektdateien kopieren (behebt das Rollup-Problem)
|
||||
# 1. Alle Projektdateien in den Container bringen
|
||||
COPY . .
|
||||
|
||||
# 2. Frisch installieren passend zur aktuellen Alpine-Architektur
|
||||
# 2. Lockfile-Validierung erzwingen und die Linux-Binärdateien explizit nachziehen
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# HIER DER FIX: Zwingt den virtuellen pnpm-Store, das Linux-Musl-Paket physisch bereitzustellen
|
||||
RUN pnpm add -w @rollup/rollup-linux-x64-musl --save-optional --config.ignore-scripts=false
|
||||
|
||||
ENV BASE_PATH=/
|
||||
RUN pnpm --filter @workspace/api-server --filter @workspace/toolrate -r --if-present run build
|
||||
|
||||
@@ -17,7 +20,6 @@ WORKDIR /app
|
||||
|
||||
RUN npm install -g pnpm@10.26.1
|
||||
|
||||
# Im Runner-Stage kopieren wir nur die Paketdateien für die Prod-Installation
|
||||
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./
|
||||
COPY lib/db/package.json lib/db/
|
||||
COPY lib/api-spec/package.json lib/api-spec/
|
||||
@@ -26,10 +28,11 @@ COPY lib/api-client-react/package.json lib/api-client-react/
|
||||
COPY artifacts/api-server/package.json artifacts/api-server/
|
||||
COPY artifacts/toolrate/package.json artifacts/toolrate/
|
||||
|
||||
# Produktions-Abhängigkeiten installieren
|
||||
RUN pnpm install --frozen-lockfile --prod
|
||||
|
||||
# Kompilierte Artefakte aus dem Builder holen
|
||||
# Auch für den Runner-Stage stellen wir sicher, dass das Paket im Produktiv-Image existiert
|
||||
RUN pnpm add -w @rollup/rollup-linux-x64-musl --save-optional --prod
|
||||
|
||||
COPY --from=builder /app/lib/db/dist lib/db/dist
|
||||
COPY --from=builder /app/artifacts/api-server/dist artifacts/api-server/dist
|
||||
COPY --from=builder /app/artifacts/toolrate/dist artifacts/toolrate/dist
|
||||
|
||||
Reference in New Issue
Block a user