Update Dockerfile and scripts

This commit is contained in:
Keannu Bernasol 2024-11-27 00:32:53 +08:00
parent 5bc170f519
commit 6a8f81c954
3 changed files with 4 additions and 1 deletions

View file

@ -10,7 +10,7 @@ COPY scripts/ /app/scripts/
RUN chmod +x /app/scripts/start.sh RUN chmod +x /app/scripts/start.sh
# Install packages # 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 RUN pip3 install --upgrade pip && pip3 install --no-cache-dir -r requirements.txt
# Expose port 8000 for the web server # Expose port 8000 for the web server

View file

@ -57,5 +57,6 @@ typing_extensions==4.12.2
tzdata==2024.2 tzdata==2024.2
uritemplate==4.1.1 uritemplate==4.1.1
urllib3==2.2.3 urllib3==2.2.3
watchdog==6.0.0
whitenoise==6.8.2 whitenoise==6.8.2
pygraphviz==1.14; platform_system == 'Linux' pygraphviz==1.14; platform_system == 'Linux'

View file

@ -9,7 +9,9 @@ if [ ! -d "static" ]; then
python manage.py collectstatic --noinput python manage.py collectstatic --noinput
fi fi
if [ "$DEBUG" = 'True' ]; then 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" python manage.py runserver "0.0.0.0:8000"
else 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 gunicorn --workers 8 --bind 0.0.0.0:8000 config.wsgi:application
fi fi