|
|
|
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/python:latest-dev |
|
|
|
|
|
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/python:latest-dev |
|
|
|
FROM $LITELLM_BUILD_IMAGE AS builder |
|
|
|
|
|
WORKDIR /app |
|
|
|
USER root |
|
|
|
|
|
RUN apk update && \ |
|
apk add --no-cache gcc python3-dev openssl openssl-dev |
|
|
|
|
|
RUN pip install --upgrade pip && \ |
|
pip install build |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN chmod +x docker/build_admin_ui.sh && ./docker/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 |
|
|
|
|
|
FROM $LITELLM_RUNTIME_IMAGE AS runtime |
|
|
|
|
|
USER root |
|
|
|
|
|
RUN apk update && \ |
|
apk add --no-cache openssl |
|
|
|
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 pip install redisvl==0.0.7 --no-deps |
|
|
|
|
|
RUN pip uninstall jwt -y |
|
RUN pip uninstall PyJWT -y |
|
RUN pip install PyJWT==2.9.0 --no-cache-dir |
|
|
|
|
|
RUN chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh |
|
|
|
|
|
RUN prisma generate |
|
RUN chmod +x docker/entrypoint.sh |
|
RUN chmod +x docker/prod_entrypoint.sh |
|
EXPOSE 4000/tcp |
|
|
|
|
|
|
|
ENTRYPOINT ["docker/prod_entrypoint.sh"] |
|
|
|
|
|
|
|
CMD ["--port", "4000"] |
|
|