Skip to content

enhance(docker): template update on page refresh - #145

Draft
wesleyboar wants to merge 8 commits into
tapis-project:devfrom
wesleyboar:dx-mount-templates-volume
Draft

enhance(docker): template update on page refresh#145
wesleyboar wants to merge 8 commits into
tapis-project:devfrom
wesleyboar:dx-mount-templates-volume

Conversation

@wesleyboar

@wesleyboar wesleyboar commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Overview

When developing locally, template edits should be reflected on page after page refresh without needing to rebuild the image, so I mount the local ./service/templates directory into the authenticator container.

Caution

This docker-compose.yml is used on production, so I must instead:

  • document this as useful for dev env
  • offer via docker-compose.local.py
  • follow peer direction

Changes

  • added ./service/templates volume mount to authenticator service in docker-compose.yml

Testing

  1. Start up the app.
  2. Edit a file in service/templates/
  3. Refresh the browser/page.
  4. Changes appear without rebuilding image.

UI

Test.Docker.Volume.Mount.of.Templates.mov

@wesleyboar wesleyboar changed the title chore(docker): mount templates volume for live reload enhance(docker): mount templates volume for live reload Jun 24, 2026
Mounts ./service/templates into the authenticator container so templates
can be edited and refreshed without rebuilding the image.
@wesleyboar
wesleyboar force-pushed the dx-mount-templates-volume branch from 90763cf to 0f66b07 Compare June 25, 2026 00:00
@wesleyboar
wesleyboar changed the base branch from prod to dev June 30, 2026 20:13
@gcurbelo123

gcurbelo123 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

This alone didn't enable hot reload, I also had to add this at line 26 in models.py:
app.config['TEMPLATES_AUTO_RELOAD'] = True

@wesleyboar wesleyboar changed the title enhance(docker): mount templates volume for live reload enhance(docker): mount templates volume so refresh loads template change Jun 30, 2026
@wesleyboar

Copy link
Copy Markdown
Contributor Author

@gcurbelo123, true. I shouldn't have said "live reload". I've renamed the PR to instead describe accurately what it does. My intent was not automatic reload, but just to make page refresh result in latest template.

@wesleyboar wesleyboar changed the title enhance(docker): mount templates volume so refresh loads template change enhance(docker): mount templates volume so page refresh uses changed template Jun 30, 2026
Mounting templates alone did not hot-reload them; Flask also needs
TEMPLATES_AUTO_RELOAD enabled to re-read template files per request.
@wesleyboar

Copy link
Copy Markdown
Contributor Author

@gcurbelo123, sorry. Fixed now. I misunderstood your comment as a request for auto reload on file change, but it is a bug1 report.

Footnotes

  1. File change and refresh alone, inadequate (because cache).

@wesleyboar wesleyboar left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

This is used on prod. Make it dev-only.

Technically that docker-compose is used to build in jenkins. So an extra - ./service/templates:/home/tapis/service/templates could introduce out-changes we don't want if it gets built on an unclean repo. And there could be local issues if a user directly publishes.
@NotChristianGarcia

I'm not against the dev docker-compose change. But it might be possible to add a new Makefile target called make dev or make local for the reload explicitly? The build job makes make build currently. So just something to be aware of.
@NotChristianGarcia

@wesleyboar
wesleyboar marked this pull request as draft September 4, 2026 18:15
@wesleyboar wesleyboar changed the title enhance(docker): mount templates volume so page refresh uses changed template enhance(docker): template update on page refresh Sep 4, 2026
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.

4 participants