Created
April 30, 2025 21:56
-
-
Save paltaio-admin/83a3f523d56d2e23aa1a01e7ec2f6802 to your computer and use it in GitHub Desktop.
Caddy check config (docker)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Validate the Caddy configuration | |
| if docker exec -it caddy caddy validate --config /etc/caddy/Caddyfile; then | |
| echo "Valid configuration. Reloading Caddy..." | |
| # Hot reload the Caddy service with the new configuration | |
| docker exec -it caddy caddy fmt --overwrite /etc/caddy/Caddyfile | |
| docker exec -it caddy caddy reload --config /etc/caddy/Caddyfile --adapter caddyfile | |
| else | |
| echo "Configuration validation failed. Hot reload aborted." | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment