From 85e9e6b26fe5798ccec3c35076d3e450b9d7eab4 Mon Sep 17 00:00:00 2001
From: Artem Baranovskyi <artem.baranovsky1980@gmail.com>
Date: Tue, 7 Jan 2025 21:19:59 +0200
Subject: [PATCH] Image build is optimized.

---
 .gitlab-ci.yml          |  2 +-
 flask_ml_api/Dockerfile | 12 +++++-------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d907344..bccbc96 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -62,4 +62,4 @@ deploy:
     - docker pull 22baar1mst/asyst-nlp-grader:latest
     - docker run -d 22baar1mst/asyst-nlp-grader:latest
   only:
-    - master
\ No newline at end of file
+    - master
diff --git a/flask_ml_api/Dockerfile b/flask_ml_api/Dockerfile
index 19bf108..80ea622 100755
--- a/flask_ml_api/Dockerfile
+++ b/flask_ml_api/Dockerfile
@@ -1,14 +1,12 @@
 FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime as build
 
 RUN apt-get update && apt-get install -y curl
-RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh
-RUN sh rustup-init.sh -y --default-toolchain none
-RUN ~/.cargo/bin/rustup toolchain install stable --profile minimal --no-self-update
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /usr/local/bin/rustup-init.sh
+RUN /usr/local/bin/rustup-init.sh -y --default-toolchain none
+RUN /usr/local/bin/rustup toolchain install stable --profile minimal --no-self-update
 
-ENV PATH="$PATH:$HOME/.cargo/bin"
-
-RUN rustup --version
-RUN cargo --version
+RUN /usr/local/bin/rustup --version
+RUN /usr/local/bin/cargo --version
 
 RUN apt-get update && apt-get install -y --no-install-recommends \
     build-essential python3-venv && \
-- 
GitLab