feat(nginx): Add Nginx reload script

This commit is contained in:
hygienic-books 2023-03-16 01:35:16 +01:00
parent 0389daf17a
commit 3696f0a15f

6
nginx_reload.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
declare nginx_container="${1:?}"
if [[ "$( docker container inspect -f '{{.State.Running}}' "${nginx_container}" 2> /dev/null )" == "true" ]]; then
docker exec -t "${nginx_container}" sh -c 'nginx -t &>/dev/null' && \
docker kill --signal SIGHUP "${nginx_container}"
fi