feat: reduce docker image size by removing unnecessary cache (#174) (#none)

* feat: reduce docker image size by removing unnecessary cache

* fix: trailing whitespace
This commit is contained in:
nguyen 2024-09-02 18:13:53 +07:00 committed by GitHub
parent 35b2927e5c
commit 4f0785773d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,15 +9,17 @@ FROM python:3.10-slim as base_image
# libxext6 \ # libxext6 \
# ffmpeg \ # ffmpeg \
RUN apt update -qqy \ RUN apt-get update -qqy && \
&& apt install -y \ apt-get install -y --no-install-recommends \
ssh git \ ssh \
gcc g++ \ git \
poppler-utils \ gcc \
libpoppler-dev \ g++ \
&& \ poppler-utils \
apt-get clean && \ libpoppler-dev \
apt-get autoremove && apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
@ -29,9 +31,9 @@ WORKDIR /app
FROM base_image as dev FROM base_image as dev
COPY . /app COPY . /app
RUN --mount=type=ssh pip install -e "libs/kotaemon[all]" RUN --mount=type=ssh pip install --no-cache-dir -e "libs/kotaemon[all]" \
RUN --mount=type=ssh pip install -e "libs/ktem" && pip install --no-cache-dir -e "libs/ktem" \
RUN pip install graphrag future && pip install --no-cache-dir graphrag future \
RUN pip install "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements" && pip install --no-cache-dir "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements"
ENTRYPOINT ["gradio", "app.py"] ENTRYPOINT ["gradio", "app.py"]