Skip to content

Conversation

@lawso017
Copy link
Contributor

While managing a supabase app server using the app.yml playbook, I was running into issues where changes in either the deployed source or environment variables didn't trigger a restart of the docker containers.

This app-sync.yml playbook provides restarts on changes with a slightly different approach:

1/ Use rsync to synchronize sources, with the caveat that we do not delete (since containers manage volumes) and we ignore timestamps (since volume timestamps change when containers run). This lets us track changes to deployed source.
2/ Calculate a hash of the .env file before and after it is modified to detect changes.

If 1 or 2 change, then docker compose will restart the containers (unless, of course, they were just started by app_launch).

I've only used this with supabase but wanted to pass it along if you thought the it would be generally useful.

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.

1 participant