Files
tool-evaluator/Dockerfile
T
henry 0f611e8a44
Build & Push Docker Image / build (push) Failing after 1m53s
Update Dockerfile
2026-07-31 11:55:13 +00:00

46 lines
1.6 KiB
Docker

FROM node:24-alpine AS builder
WORKDIR /app
RUN npm install -g pnpm@10.26.1
# 1. Alle Projektdateien in den Container bringen
COPY . .
# 2. Abhängigkeiten installieren
RUN pnpm install --frozen-lockfile
# HIER DER FIX: Zwingt pnpm, sowohl die Rollup- als auch die LightningCSS-Binärdateien für Alpine bereitzustellen
RUN pnpm add -w @rollup/rollup-linux-x64-musl lightningcss-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
FROM node:24-alpine AS runner
WORKDIR /app
RUN npm install -g pnpm@10.26.1
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/
COPY lib/api-zod/package.json lib/api-zod/
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/
RUN pnpm install --frozen-lockfile --prod
# Auch für den Runner-Stage stellen wir sicher, dass beide Pakete im Produktiv-Image existieren
RUN pnpm add -w @rollup/rollup-linux-x64-musl lightningcss-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
ENV NODE_ENV=production
ENV STATIC_DIR=/app/artifacts/toolrate/dist/public
EXPOSE 8080
CMD ["node", "--enable-source-maps", "artifacts/api-server/dist/index.mjs"]