tjwalch/django-livereload-server

Running in docker compose seems to break livereload

EmmanuelMess opened this issue · 5 comments

Is there a way to run server in dockercompose and have livereload work?

Yes, it is possible. What issue are you having?

I am having trouble executing livereload on the same container, the recommended way doesn't see to work. I have a single service in my docker compose that runs a script:

#!/bin/sh

# Start the first process
python /app/manage.py livereload &
  
# Start the second process
python /app/manage.py runserver localhost:8000 & 
  
# Wait for any process to exit
wait -n
  
# Exit with status of process that exited first
exit $?

Okay, this seems to load a page, but doesn't reload:

#!/bin/sh

# Start the first process
python /app/manage.py livereload &

# Start the second process
python /app/manage.py runserver 0.0.0.0:8000 &

# Wait for any process to exit
wait -n

# Exit with status of process that exited first
exit $?

For anyone having this issue, make sure you run inside docker containers with
python manage.py livereload --host=0.0.0.0

@EmmanuelMess @Danjoe4 Can we close this if the issue has been resolved? I think that this is a configuration issue for running inside of Docker, and not an issue with this project.