From 6a8f81c954ad9fe79172192f89e099a14cdc1578 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Wed, 27 Nov 2024 00:32:53 +0800 Subject: [PATCH] Update Dockerfile and scripts --- Dockerfile | 2 +- requirements.txt | 1 + scripts/start.sh | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ba0ca07..eab3bc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ COPY scripts/ /app/scripts/ RUN chmod +x /app/scripts/start.sh # Install packages -RUN apt update && apt install -y graphviz libgraphviz-dev graphviz-dev tesseract-ocr +RUN apt update && apt install -y graphviz libgraphviz-dev graphviz-dev tesseract-ocr tmux RUN pip3 install --upgrade pip && pip3 install --no-cache-dir -r requirements.txt # Expose port 8000 for the web server diff --git a/requirements.txt b/requirements.txt index eb57c31..5e3db18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -57,5 +57,6 @@ typing_extensions==4.12.2 tzdata==2024.2 uritemplate==4.1.1 urllib3==2.2.3 +watchdog==6.0.0 whitenoise==6.8.2 pygraphviz==1.14; platform_system == 'Linux' \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh index ee81d26..1db65bd 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -9,7 +9,9 @@ if [ ! -d "static" ]; then python manage.py collectstatic --noinput fi if [ "$DEBUG" = 'True' ]; then + tmux new-session -d -s "API File Watcher" "cd /app/docmanager_backend && python manage.py start_watcher" python manage.py runserver "0.0.0.0:8000" else + tmux new-session -d -s "API File Watcher" "cd docmanager_backend && python manage.py start_watcher" gunicorn --workers 8 --bind 0.0.0.0:8000 config.wsgi:application fi