From be43321eab1a450f2f7b6cd288928b6bd2449a7d Mon Sep 17 00:00:00 2001 From: reddexx Date: Mon, 11 Jul 2022 17:00:53 +0200 Subject: [PATCH] Update Dockerfile A Working Version for a Docker File for All Architecture Image is uploaded for Arm64 Architecture https://hub.docker.com/r/reddexx/lama-cleaner --- Dockerfile | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6630fe4..0c273e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ # # Lama Cleaner Dockerfile -# @author Loreto Parisi (loretoparisi at gmail dot com) +# @author Reddexx # -FROM python:3.7.4-slim-buster - -LABEL maintainer Loreto Parisi loretoparisi@gmail.com +FROM python:3.8.13-slim-bullseye +ENV LAMA_CLEANER_VERSION=0.14.0 +LABEL maintainer Reddexx WORKDIR app @@ -16,9 +16,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ npm # python requirements -COPY . . -COPY requirements.txt /etc/tmp/requirements.txt -RUN pip install -r /etc/tmp/requirements.txt + +RUN pip install torch>=1.8.2 opencv-python flask_cors flask==1.1.4 flaskwebgui tqdm pydantic loguru pytest markupsafe==2.0.1 # nodejs RUN npm install n -g && \ @@ -26,11 +25,16 @@ RUN npm install n -g && \ # yarn RUN npm install -g yarn +#Create Directory +RUN mkdir -p /lama_cleaner && cd /lama_cleaner + # webapp -RUN cd lama_cleaner/app/ && \ - yarn && \ - yarn build +RUN set -x; curl -SL -o lama-cleaner.tar.gz https://github.com/Sanster/lama-cleaner/archive/refs/tags/${LAMA_CLEANER_VERSION}.tar.gz && \ +tar xvf lama-cleaner.tar.gz -C /lama_cleaner --strip-components=1 && \ +rm lama-cleaner.tar.gz + +RUN cd /lama_cleaner/lama_cleaner/app && yarn && yarn build EXPOSE 8080 -CMD ["bash"] \ No newline at end of file +CMD ["bash"]