From 4b81bea2941829a96c5a123e19490be1d44deff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix?= Date: Fri, 8 Mar 2024 15:58:17 +0100 Subject: [PATCH 1/3] persistence of projects.json in docker --- panoptic_back/panoptic/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/panoptic_back/panoptic/utils.py b/panoptic_back/panoptic/utils.py index f12067d4..6ac17e52 100644 --- a/panoptic_back/panoptic/utils.py +++ b/panoptic_back/panoptic/utils.py @@ -22,8 +22,9 @@ def get_datadir() -> pathlib.Path: """ home = pathlib.Path.home() - - if sys.platform == "win32": + if os.getenv('IS_DOCKER', False): + return pathlib.Path('/projects') + elif sys.platform == "win32": return home / "AppData/Roaming" elif sys.platform == "linux": return home / ".local/share" From d13ebc50d7b31dc60dad576155324efdd81c4445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix?= Date: Fri, 8 Mar 2024 16:12:01 +0100 Subject: [PATCH 2/3] persistence of projects.json in docker v2 --- Dockerfile | 1 + panoptic_back/panoptic/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3e96c421..171f5a64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ RUN chown -R 1000:1000 /data/ RUN chmod -R 777 /data/ ENV PANOPTIC_HOST="0.0.0.0" +ENV IS_DOCKER="True" EXPOSE 8000 diff --git a/panoptic_back/panoptic/utils.py b/panoptic_back/panoptic/utils.py index 6ac17e52..2c3813ec 100644 --- a/panoptic_back/panoptic/utils.py +++ b/panoptic_back/panoptic/utils.py @@ -23,7 +23,7 @@ def get_datadir() -> pathlib.Path: home = pathlib.Path.home() if os.getenv('IS_DOCKER', False): - return pathlib.Path('/projects') + return pathlib.Path('/data') elif sys.platform == "win32": return home / "AppData/Roaming" elif sys.platform == "linux": From be23fb2b494858d8e97c858fb366075b2a3a8773 Mon Sep 17 00:00:00 2001 From: Marceau-h Date: Fri, 8 Mar 2024 16:44:27 +0100 Subject: [PATCH 3/3] Update on the dockers --- Dockerfile | 2 +- Dockerfile-base.dockerfile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 171f5a64..71ddad89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM tyrannas/panoptic-clip-base:latest +FROM ceressorbonne/panoptic-clip-base:latest COPY . /app WORKDIR ./app/panoptic_back/ diff --git a/Dockerfile-base.dockerfile b/Dockerfile-base.dockerfile index baff3a21..30015ac6 100644 --- a/Dockerfile-base.dockerfile +++ b/Dockerfile-base.dockerfile @@ -1,5 +1,7 @@ -FROM python:3 +FROM python:3.12.2-bullseye +RUN pip3 install -U pip +RUN pip3 install MarkupSafe RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu RUN pip3 install --force-reinstall transformers typing-extensions