Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more efficient reloader in backend container #83

Open
simonbru opened this issue Jan 9, 2020 · 0 comments
Open

Use more efficient reloader in backend container #83

simonbru opened this issue Jan 9, 2020 · 0 comments

Comments

@simonbru
Copy link
Contributor

simonbru commented Jan 9, 2020

Django's dev server uses almost no CPU time when idle with the watchman reloader. However this requires the watchman binary and pywatchman library.

The watchman binary is packaged in debian bullseye, but not the current stable release (buster).
I tried copying the binary from a 3rd party image in the Dockerfile. It is ugly but it works:

COPY --from=workbenchdata/watchman-bin:latest-buster-slim /usr/bin/watchman /usr/local/bin/
RUN install -m777 -d /usr/var/run/watchman/

An alternative solution could be to use runserver_plus from django extensions with the watchdog reloader. It is less efficient (~2% of idle CPU usage on my machine), but easier to setup (we just need to add watchdog to dev requirements).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant