From 647b614d804d7a02b5778660595f35c5ea5455a0 Mon Sep 17 00:00:00 2001
From: Niaz Faridani-Rad <tigrexspalterlp@gmail.com>
Date: Mon, 11 Oct 2021 16:05:22 +0200
Subject: [PATCH] Conditional installation of pytorch

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

diff --git a/backend/dependencies/Dockerfile b/backend/dependencies/Dockerfile
index 8e87231..9ae337f 100644
--- a/backend/dependencies/Dockerfile
+++ b/backend/dependencies/Dockerfile
@@ -1,6 +1,6 @@
 FROM ubuntu:20.04
 # system packages installation
-
+ARG TARGETPLATFORM
 ENV DEBIAN_FRONTEND=noninteractive
 
 RUN apt-get update && \
@@ -49,8 +49,10 @@ RUN apt-get update && \
     apt-get clean && \
     rm -rf /var/lib/apt/lists/*
 
-RUN pip3 install torch torchvision pyvips==2.1.15 cmake==3.21.2
+RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then pip3 install torch torchvision; 
+RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then pip3 install torch torchvision -f https://torch.kmtea.eu/whl/stable.html;
 
+RUN pip3 install pyvips==2.1.15 cmake==3.21.2
 
 #Build and install libraw
 WORKDIR /tmp/builds
-- 
GitLab