Skip to content

Commit

Permalink
Use watchfiles to auto reload the Huey workers, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Diemer committed Nov 17, 2023
1 parent 4a6096d commit ca97698
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN set -x \
&& apt-get install -y postgresql-client python3-pip \
&& rm -rf /var/lib/apt \
&& python3 -m pip install -U pip \
&& pip3 install -U setuptools psycopg2-binary
&& pip3 install -U setuptools psycopg2-binary watchfiles

WORKDIR /django

Expand Down
6 changes: 5 additions & 1 deletion docker/django/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ echo "$(date +%c) - ${0} $*"
/django/docker/utils/init.sh "${1}"

./manage.py --help
./manage.py run_dev_server django:8000

# Needed for AlwaysLoggedInAsSuperUserMiddleware:
export RUN_MAIN=true

watchfiles --filter python "python manage.py run_dev_server --noreload django:8000" /django/
echo "runserver terminated with exit code: $?"
sleep 3
exit 1
Expand Down
2 changes: 1 addition & 1 deletion docker/huey/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ echo "$(date +%c) - ${0} $*"
/django/docker/utils/init.sh "${1}"

./manage.py --help
./manage.py run_huey --worker-type process --workers 2
watchfiles --filter python "python manage.py run_huey --worker-type process --workers 2" /django/
echo "Huey terminated with exit code: $?"
sleep 3
exit 1
Expand Down

0 comments on commit ca97698

Please sign in to comment.