mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
fix(headroom-proxy): use multi-stage build with Rust 1.87 to compile headroom._core extension
This commit is contained in:
parent
654f610693
commit
3c7daf6e6c
1 changed files with 13 additions and 6 deletions
|
|
@ -1,15 +1,22 @@
|
|||
FROM python:3.12-slim
|
||||
FROM rust:1.87-slim-bookworm AS builder
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends build-essential \
|
||||
&& pip install --no-cache-dir "headroom-ai[proxy]==0.27.0" \
|
||||
&& apt-get purge -y build-essential \
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get install -y --no-install-recommends python3 python3-pip python3-venv build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN python3 -m venv /opt/venv
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
RUN pip install --no-cache-dir "headroom-ai[proxy]==0.27.0"
|
||||
|
||||
|
||||
FROM python:3.12-slim-bookworm
|
||||
|
||||
COPY --from=builder /opt/venv /opt/venv
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
EXPOSE 8787
|
||||
|
||||
ENV HEADROOM_TELEMETRY=off
|
||||
ENV HEADROOM_REQUIRE_RUST_CORE=false
|
||||
|
||||
CMD ["headroom", "proxy", "--host", "0.0.0.0", "--port", "8787", "--no-optimize"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue