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

Automatic reloading of uwsgi in docker developer environment #674

Closed

Conversation

dot-mike
Copy link
Contributor

@dot-mike dot-mike commented Mar 8, 2024

This makes uwsgi reload when changes are detected for python or static files in Docker environment for developers.
The user only has to refresh the application in the web-browser to see the changes.

I've updated contributing.md and added a Makefile to make life easier and I hope you accept it.

Run this command from the terminal to start the improved developer stack or use make dev :)

docker compose -f docker-compose.dev.yml up --build

This makes uwsgi reload when changes are detected for python or static files in developer-only environment.
@bbilly1
Copy link
Member

bbilly1 commented Apr 3, 2024

Honestly this is too much complexity. The more we differ the dev setup to what users are running, the more difficult it is to test things, especially until we have that automated.

Also I want to avoid duplicating the compose file and the uwsgi file.

Rebuilding on change hasn't been too much of an issue for me, it just takes a few seconds, as all layers except for the application can be cached.

Djangos builtin server has autoreload implemented, I've recently started using that.

More or less in run.sh:

if [[ -z "$TESTING_ENV" ]]; then
    uwsgi --ini uwsgi.ini
else
    python manage.py runserver 0.0.0.0:8001
fi

So when you add TESTING_ENV to the compose file this will start the django server instead on port 8001. then you can mount the /app folder as a volume and you have autoreload implemented.

That would be easy enough to explain in CONTRIBUTING.md without needing to duplicate everything and adding overhead.

@bbilly1
Copy link
Member

bbilly1 commented May 15, 2024

we will revisit a better dev setup with hopefully hot reloading when we make the split with the frontend.

@bbilly1 bbilly1 closed this May 15, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants