From 12cd831963c988f58d14ac45dfa497fd6f7743b7 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Mon, 6 Apr 2026 13:53:53 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20slim=20Dockerfile=20=E2=80=94=20server?= =?UTF-8?q?=20needs=20no=20Python/torch=20(workers=20handle=20execution)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index f497134..a2898f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,21 +6,13 @@ RUN npm ci COPY web/ ./ RUN npm run build -# Stage 2: Runtime (debian for glibc — torch/sentence-transformers need manylinux wheels) -FROM debian:bookworm-slim -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* -RUN curl -LsSf https://astral.sh/uv/install.sh | sh -ENV PATH="/root/.local/bin:$PATH" -RUN uv venv --python 3.12 /app/venv && uv pip install --python /app/venv/bin/python sentence-transformers -RUN /app/venv/bin/python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')" -# Pre-warm uv cache with common packages (shared across all project venvs) -RUN uv pip install --python /app/venv/bin/python httpx fastapi uvicorn requests flask pydantic numpy pandas matplotlib pillow jinja2 pyyaml python-dotenv beautifulsoup4 lxml aiohttp aiofiles pytest rich click typer sqlalchemy -RUN mkdir -p /app/data/workspaces +# Stage 2: Runtime — server is just a static binary + frontend assets +FROM alpine:3.20 +RUN apk add --no-cache ca-certificates +RUN mkdir -p /app/data WORKDIR /app COPY target/aarch64-unknown-linux-musl/release/tori . COPY --from=frontend /app/web/dist ./web/dist/ -COPY scripts/embed.py ./scripts/ -COPY app-templates/ ./templates/ COPY config.yaml . EXPOSE 3000