|
|
|
ARG LITELLM_BUILD_IMAGE=python:3.11.8-slim |
|
|
|
|
|
ARG LITELLM_RUNTIME_IMAGE=python:3.11.8-slim |
|
|
|
FROM $LITELLM_BUILD_IMAGE as builder |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get clean && apt-get update && \ |
|
apt-get install -y gcc python3-dev && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
RUN pip install --upgrade pip && \ |
|
pip install build |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN chmod +x build_admin_ui.sh && ./build_admin_ui.sh |
|
|
|
|
|
RUN rm -rf dist/* && python -m build |
|
|
|
|
|
RUN ls -1 dist/*.whl | head -1 |
|
|
|
|
|
RUN pip install dist/*.whl |
|
|
|
|
|
RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt |
|
|
|
|
|
RUN pip install redisvl==0.0.7 --no-deps |
|
|
|
|
|
RUN pip uninstall jwt -y |
|
RUN pip uninstall PyJWT -y |
|
RUN pip install PyJWT --no-cache-dir |
|
|
|
|
|
RUN chmod +x build_admin_ui.sh && ./build_admin_ui.sh |
|
|
|
|
|
FROM $LITELLM_RUNTIME_IMAGE as runtime |
|
|
|
WORKDIR /app |
|
|
|
COPY . . |
|
RUN ls -la /app |
|
|
|
|
|
COPY --from=builder /app/dist/*.whl . |
|
COPY --from=builder /wheels/ /wheels/ |
|
|
|
|
|
RUN pip install *.whl /wheels/* --no-index --find-links=/wheels/ && rm -f *.whl && rm -rf /wheels |
|
|
|
|
|
RUN prisma generate |
|
RUN chmod +x entrypoint.sh |
|
|
|
EXPOSE 4000/tcp |
|
|
|
ENTRYPOINT ["litellm"] |
|
|
|
|
|
|
|
CMD ["--port", "4000", "--config", "./proxy_server_config.yaml"] |