#181 Auto reflecting of changes in front-end files (templates & static files) in browser.
Closed: complete 4 years ago by jflory7. Opened 5 years ago by revanth.

Summary

Code changes in templates or static files are not being reflected in the browser while running using "docker-compose up"

Background

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.

Details

Small changes in docker-compose.yml would fulfil the need.

Outcome

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

5 years ago

@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 ?
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 ?
docker-volumes.png

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 :)

@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

5 years ago

Metadata Update from @jflory7:
- Assignee reset
- Issue tagged with: help wanted

4 years ago

Metadata Update from @shraddhaag:
- Issue assigned to shraddhaag

4 years ago

Metadata Update from @jflory7:
- Issue untagged with: help wanted
- Issue set to the milestone: Summer Coding 2019: phase 1

4 years ago

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)

4 years ago

Login to comment on this ticket.

Metadata
Attachments 1
Attached 5 years ago View Comment