From f97076bf4949c6997120c91962ea2d136491cc36 Mon Sep 17 00:00:00 2001 From: anasty17 Date: Thu, 14 Nov 2024 11:55:41 +0200 Subject: [PATCH] Use venv instead of breaking system packges Signed-off-by: anasty17 --- .gitignore | 1 + Dockerfile | 4 +++- start.sh | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 58c59c3e..0b037971 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +mltbenv/* config.env *.pyc data* diff --git a/Dockerfile b/Dockerfile index b3cad464..1e757c6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,10 @@ FROM anasty17/mltb:latest WORKDIR /usr/src/app RUN chmod 777 /usr/src/app +RUN python3 -m venv mltbenv + COPY requirements.txt . -RUN pip3 install --no-cache-dir -r requirements.txt --break-system-packages +RUN mltbenv/bin/pip install --no-cache-dir -r requirements.txt COPY . . diff --git a/start.sh b/start.sh index 9b2bf653..50bd8615 100644 --- a/start.sh +++ b/start.sh @@ -1 +1,3 @@ -python3 update.py && python3 -m bot +source mltbenv/bin/activate +python3 update.py +python3 -m bot