Commit 4427d51
committed
entrypoint: Monitor config dir for changes
We see a lot of crudges and hacks to notify nginx or the nginx container
informing it it needs to restart. While there certainly cases that
require manual control, for the most, this could be easily automated.
With inotify, we can recursively monitor /etc/nginx (or any directory
per config) for changes (currently, not monitoring for for access time
changes, e.g. reads or `touch` events). On an event, we sleep first for
(configurable) seconds, the default is 10, so that multiple updates
don't cause multiple restarts. E.g. copying 10 certificates into
/etc/nginx/certs, won't trigger 10 reloads.
The monitor will run indefinably, and can't be easily killed. This isn't
a problem however, as this is specifically a docker entry point and it
is fair to assume this will only ever be run under docker.
The current configuration won't change existing behavior, it needs to be
explicitly enabled.
Signed-off-by: Olliver Schinagl <[email protected]>1 parent 10fa7fc commit 4427d51
File tree
2 files changed
+41
-0
lines changed- entrypoint
2 files changed
+41
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments