diff --git a/cron_job.sh b/cron_job.sh new file mode 100644 index 0000000..589f3ab --- /dev/null +++ b/cron_job.sh @@ -0,0 +1,12 @@ +# Cleanup exited docker containers +EXITED_CONTAINERS=$(docker ps -a | grep Exited | awk '{ print $1 }') +if [ -z "$EXITED_CONTAINERS" ] +then + echo "No exited containers to clean" +else + docker rm $EXITED_CONTAINERS +fi + +# renew certbot certificate +docker compose run --rm certbot +docker compose exec nginx nginx -s reload