dockerizing-django
dockerizing-django copied to clipboard
Not changing code before run unit tests
When I create and run the container, I run the tests to check the result. But when I make a change, it is not reflected and shows the same result. How can he see this change in code?
Can you post the Github link to your code?
Sent from my iPhone
On May 12, 2016, at 7:32 AM, Gilson Filho [email protected] wrote:
When I create and run the container, I run the tests to check the result. But when I make a change, it is not reflected and shows the same result. How can he see this change in code?
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub
Gunicorn does not do auto reload changes in your code by default. You can add param --reload to gunicron, but it is not recommend to do this in prd env, cause it may lead to memory lead.
In my opinion the right way is to stop & rm the container, thne docker-compose build, then docker-compose start
@FingerLiu in development this can be pretty burdensome. Any suggestions?
I'd say use a volume for local development and runserver instead of gunicorn, so code is reloaded whenever you make a change.
Agreed @dukebody. That's how I set up the compose file.
Maybe in development, runserver is enough, but if a man insist to use gunicorn , he can just simply add --reload to https://github.com/realpython/dockerizing-django/blob/master/docker-compose.yml#L15
as command: /usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000 --reload
@gilsondev Did you see updated code inside Docker container? Which version of Docker you use and on which host OS?