From 11d0dd218558a998deb218c76b57b500f8b1d8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Mo=C5=A1a=C5=A5?= Date: Fri, 6 Oct 2023 10:12:37 +0200 Subject: [PATCH] Limit max threads --- Dockerfile | 8 +++++--- docker-compose.development.yml | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index c6f06b1b..07e414ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ FROM python:3.10-slim -WORKDIR /var/www/ +WORKDIR /rembg -RUN python -m pip install "rembg[cli]" +COPY . . + +RUN python -m pip install ".[cli]" RUN python -c 'from rembg.bg import download_models; download_models()' EXPOSE 5000 ENTRYPOINT ["rembg"] -CMD ["s"] +CMD ["s", "-t 8"] diff --git a/docker-compose.development.yml b/docker-compose.development.yml index d6bae847..6ccfe3ea 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -6,7 +6,7 @@ services: context: . tty: true stdin_open: true - volumes: - - "./:/var/www" ports: - - "5100:5000" + - "6200:5000" + environment: + OMP_NUM_THREADS: 4