Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch: sync+reload mode #12318

Open
torarnv opened this issue Nov 24, 2024 · 3 comments · May be fixed by #12330
Open

Watch: sync+reload mode #12318

torarnv opened this issue Nov 24, 2024 · 3 comments · May be fixed by #12330

Comments

@torarnv
Copy link

torarnv commented Nov 24, 2024

Description

Sometimes the container supports explicit reloads of the config. E.g. Caddy can do caddy reload --config /etc/caddy/Caddyfile

In this mode the container doesn't need to be restarted, it's enough to do sync+reload (not sync+restart).

Would be nice if there was a sync+reload mode where a custom reload command could be provided.

Not having to restart the container would mitigate issues like #12317

@ndeloof
Copy link
Contributor

ndeloof commented Nov 25, 2024

For your use-case, we could introduce:

      watch: 
        - path: ./webapp/html
          action: sync+exec
          target: /var/www
          exec: <command to run in container by docker exec ...>

note: A comparable use-case could require to send a signal to container, typically SIGHUP to force a reset/reconfiguration of the service. Container's entrypoint could catch such a signal to run a custom command

@torarnv
Copy link
Author

torarnv commented Nov 25, 2024

An explicit exec would work, good idea!

Container's entrypoint could catch such a signal to run a custom command

I think a requirement for such a feature is that the container doesn't need any modification, ie custom entrypoint, to be able to be "watchable" by docker compose.

But yes, if the container already reacts to e.g. SIGHUP, then the exec part could be a signal. How would the exec know which process to signal? I guess it's the only one running in the container?

@ndeloof
Copy link
Contributor

ndeloof commented Nov 25, 2024

sure, this was just a note about a comparable feature request, not a XOR statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants