From 4f0785773df718a6dc7a3928482bd5b8b12c0bfc Mon Sep 17 00:00:00 2001 From: nguyen Date: Mon, 2 Sep 2024 18:13:53 +0700 Subject: [PATCH] feat: reduce docker image size by removing unnecessary cache (#174) (#none) * feat: reduce docker image size by removing unnecessary cache * fix: trailing whitespace --- Dockerfile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 497a0ad..0cd1f02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,15 +9,17 @@ FROM python:3.10-slim as base_image # libxext6 \ # ffmpeg \ -RUN apt update -qqy \ - && apt install -y \ - ssh git \ - gcc g++ \ - poppler-utils \ - libpoppler-dev \ - && \ - apt-get clean && \ - apt-get autoremove +RUN apt-get update -qqy && \ + apt-get install -y --no-install-recommends \ + ssh \ + git \ + gcc \ + g++ \ + poppler-utils \ + libpoppler-dev \ + && apt-get clean \ + && apt-get autoremove \ + && rm -rf /var/lib/apt/lists/* ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 @@ -29,9 +31,9 @@ WORKDIR /app FROM base_image as dev COPY . /app -RUN --mount=type=ssh pip install -e "libs/kotaemon[all]" -RUN --mount=type=ssh pip install -e "libs/ktem" -RUN pip install graphrag future -RUN pip install "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements" +RUN --mount=type=ssh pip install --no-cache-dir -e "libs/kotaemon[all]" \ + && pip install --no-cache-dir -e "libs/ktem" \ + && pip install --no-cache-dir graphrag future \ + && pip install --no-cache-dir "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements" ENTRYPOINT ["gradio", "app.py"]