Watch config files and auto-reload containers on changes via signal or restart
1.6K
Watch config files and automatically reload your containers when they change. No more manual docker restart after editing nginx.conf, Caddyfile, or any config.
You edit a config file. Nothing happens. You docker restart. Your users get downtime. Config-reload watches your config files and gracefully reloads the container — zero downtime, zero manual effort.
services:
config-reload:
image: zachbg/config-reload:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./nginx.conf:/watch/nginx.conf:ro
environment:
RELOAD_CONTAINER: nginx
RELOAD_SIGNAL: HUP
nginx:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
| Variable | Default | Description |
|---|---|---|
RELOAD_CONTAINER | required | Container name or label:key=value |
WATCH_DIR | /watch | Directory to watch for changes |
RELOAD_ACTION | signal | signal, restart, or exec |
RELOAD_SIGNAL | HUP | Signal to send (for signal action) |
RELOAD_CMD | nginx -s reload | Command to run (for exec action) |
DEBOUNCE | 2 | Seconds to debounce rapid changes |
WATCH_PATTERN | Comma-separated file extensions to watch (e.g., .conf,.yml) | |
WEBHOOK_URL | Notification webhook URL |
environment:
RELOAD_CONTAINER: nginx
RELOAD_ACTION: signal
RELOAD_SIGNAL: HUP
Best for: nginx, HAProxy, Apache, Prometheus
environment:
RELOAD_CONTAINER: nginx
RELOAD_ACTION: exec
RELOAD_CMD: "nginx -s reload"
Best for: Services with specific reload commands
environment:
RELOAD_CONTAINER: myapp
RELOAD_ACTION: restart
Best for: Apps without graceful reload support
services:
config-reload:
image: zachbg/config-reload:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./nginx:/watch:ro
environment:
RELOAD_CONTAINER: nginx
RELOAD_SIGNAL: HUP
WATCH_PATTERN: ".conf"
services:
config-reload:
image: zachbg/config-reload:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/dynamic:/watch:ro
environment:
RELOAD_CONTAINER: traefik
RELOAD_ACTION: restart
WATCH_PATTERN: ".yml,.yaml,.toml"
services:
config-reload:
image: zachbg/config-reload:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config:/watch:ro
environment:
RELOAD_CONTAINER: "label:app=webserver"
RELOAD_ACTION: signal
RELOAD_SIGNAL: HUP
Content type
Image
Digest
sha256:6e49924f3…
Size
16.7 MB
Last updated
6 months ago
docker pull zachbg/config-reload