Code changes in templates or static files are not being reflected in the browser while running using "docker-compose up"
At present, if any change is made in code of templates or static files, we need to use "docker-compose up --build" (As suggested by documentation) to reflect that in browser instead of normal refresh of browser window ( localhost:8000 ).
Any direct change in front-end files doesn't reflect in docker container. There must be a path linked on host machine so that it can be used by container and it enables hot reloading of content in container.
Small changes in docker-compose.yml would fulfil the need.
There will be no need of doing "docker-compose up --build" each time when you change code in templates or static files.
Just refreshing the browser will reflect the changes in static files & templates.
Metadata Update from @jflory7: - Issue priority set to: needs review (was: awaiting triage) - Issue tagged with: needs info, new change, type - internal organization, type - summer coding
@revanth This is interesting. What changes do you suggest? I agree this would be more convenient. I've done similar things when working with Jekyll sites in containers but I haven't reviewed this project's Docker image extensively yet.
@jflory7 I think we need to add volumes in docker-compose.yml : web: .... ..... volumes: - /app/static - .:/app ..... ....
-> And do docker-composer up --build which will mount the above two paths for container and any change in code directly reflects in container and browser too.
It's working in my case. Shall I raise a PR ? <img alt="docker-volumes.png" src="/fedora-commops/fedora-happiness-packets/issue/raw/files/fa1ef8628f719265cf9a180496bfa26d330f21007fc0327713d45e2736bd339d-docker-volumes.png" />
@jflory7 I think we need to add volumes in docker-compose.yml : web: .... ..... volumes: - /app/static - .:/app ..... .... -> And do docker-composer up --build which will mount the above two paths for container and any change in code directly reflects in container and browser too. It's working in my case. Shall I raise a PR ?
I was too planning to incorporate the same but was very unsure of how to do it, since docker volume was a new concept for me. I am glad that you introduced something like this @revanth :)
Thanks, @alishapapun :)
@revanth That's clever, I didn't think to use volumes. This would be a great improvement if you want to send up a PR for it! :thumbsup:
Metadata Update from @jflory7: - Issue untagged with: needs info, new change - Issue assigned to revanth - Issue priority set to: waiting on assignee (was: needs review) - Issue tagged with: PASSED, improvement
Related: PR #183
New PR #193
Metadata Update from @jflory7: - Assignee reset - Issue tagged with: help wanted
Metadata Update from @shraddhaag: - Issue assigned to shraddhaag
Metadata Update from @jflory7: - Issue untagged with: help wanted - Issue set to the milestone: Summer Coding 2019: phase 1
See PR #235 from @shraddhaag.
PR #235 merged! Thanks for tackling this one @shraddhaag. Closing as complete. :clapper:
Metadata Update from @jflory7: - Issue close_status updated to: complete - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.