Fix Dockerfile: use python:3.12-slim for pre-built wheels

pymupdf and other native deps need compilation on Alpine.
Switch to Debian-based python:3.12-slim which has pre-built
wheels available, avoiding the need for gcc/build-essential.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 14:36:16 +00:00
parent 94bc66d7c1
commit 626d39d1bb

View File

@@ -22,18 +22,23 @@ COPY web-ui/ ./
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
# ── Stage 3: Install Python deps ─────────────────────────────
FROM python:3.12-alpine AS pydeps
# ── Stage 3: Install Python deps (use slim for pre-built wheels) ──
FROM python:3.12-slim AS pydeps
WORKDIR /opt/api
COPY mcp-server/ ./mcp-server/
RUN pip install --no-cache-dir ./mcp-server
# ── Stage 4: Runner ───────────────────────────────────────────
FROM python:3.12-alpine AS runner
FROM python:3.12-slim AS runner
WORKDIR /app
# Install Node.js (needed for Next.js standalone server)
RUN apk add --no-cache nodejs
# Install Node.js 20.x
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& apt-get purge -y curl \
&& rm -rf /var/lib/apt/lists/*
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1