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

entrypoint: Monitor config dir for changes #791

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 10, 2023

  1. entrypoint: Launch our entrypoint via tini

    Even single process containers (which this one is actually not) should
    have an init system. However most init systems are too big and complex
    for containerization purposes. [Dumb-init][0] (and tini init) address
    this problem _specifically_ for Docker containers.
    
    See the [dumb-init][0] documentation for more details.
    
    [0]: https://github.com/Yelp/dumb-init
    
    Signed-off-by: Olliver Schinagl <[email protected]>
    oliv3r committed Jun 10, 2023
    Configuration menu
    Copy the full SHA
    e7e1b3c View commit details
    Browse the repository at this point in the history
  2. 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` (not creating new files) 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, but to ensure there is 'some' way to
    exit it, is to remove the pid file (configurable location) and
    triggering a `/etc/nginx` change (`touch '/etc/nginx/exit'` for example
    to create a file. It's not perfect, but probably will never be used
    anyway.
    
    The current configuration won't change existing behavior, it needs to be
    explicitly enabled.
    
    Signed-off-by: Olliver Schinagl <[email protected]>
    oliv3r committed Jun 10, 2023
    Configuration menu
    Copy the full SHA
    506fd0f View commit details
    Browse the repository at this point in the history