From d49e35a19349a2864b8a42a1a3f41cc19ecf8295 Mon Sep 17 00:00:00 2001
From: Artem Baranovskyi <artem.baranovsky1980@gmail.com>
Date: Mon, 6 Jan 2025 16:49:12 +0200
Subject: [PATCH] Image build is optimized.

---
 flask_ml_api/Dockerfile | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/flask_ml_api/Dockerfile b/flask_ml_api/Dockerfile
index 49dd2be..e69265f 100755
--- a/flask_ml_api/Dockerfile
+++ b/flask_ml_api/Dockerfile
@@ -8,10 +8,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
 RUN python3 -m venv /opt/myenv
 ENV PATH="/opt/myenv/bin:$PATH"
 
-#RUN pip install --no-cache-dir Flask matplotlib scikit-learn transformers pandas sentence_transformers && \
-#    pip install --no-cache-dir --upgrade setuptools wheel && \
-#    rm -rf /root/.cache/pip
-
 RUN pip install --no-cache-dir Flask && \
     pip install --no-cache-dir matplotlib && \
     pip install --no-cache-dir scikit-learn && \
@@ -20,6 +16,8 @@ RUN pip install --no-cache-dir Flask && \
     pip install --no-cache-dir sentence_transformers && \
     pip install --no-cache-dir --upgrade setuptools wheel
 
+RUN docker system prune -a --volumes
+
 FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
 COPY --from=build /opt/myenv /opt/myenv
 
-- 
GitLab