Skip to content

Commit

Permalink
add cronjob for certbot
Browse files Browse the repository at this point in the history
  • Loading branch information
sahil-sagwekar2652 committed Apr 24, 2024
1 parent b5ef9f1 commit f9121d8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cron_job.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f9121d8

Please sign in to comment.