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

---
 flask_ml_api/Dockerfile | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/flask_ml_api/Dockerfile b/flask_ml_api/Dockerfile
index 57c59de..4c16d3f 100755
--- a/flask_ml_api/Dockerfile
+++ b/flask_ml_api/Dockerfile
@@ -1,5 +1,4 @@
 FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
-FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
 
 RUN apt-get update && apt-get install -y --no-install-recommends \
     build-essential python3-venv && \
@@ -13,11 +12,9 @@ WORKDIR /app
 COPY . /app
 
 RUN pip install --no-cache-dir Flask matplotlib scikit-learn transformers pandas sentence_transformers && \
-    pip install --no-cache-dir --upgrade setuptools wheel
-
-RUN rm -rf /root/.cache/pip
+    pip install --no-cache-dir --upgrade setuptools wheel && \
+    rm -rf /root/.cache/pip
 
-# Настройка прав
 RUN chown -R www-data:www-data /app && chmod -R 755 /app
 
 EXPOSE 5000
-- 
GitLab