#!/usr/bin/env bash # certbot --deploy-hook: snap-confined Docker can't mount /etc/letsencrypt, so # copy the renewed cert into the project dir (mounted into nginx) and reload. set -e DEST=/root/statista/deploy/certs LIVE=/etc/letsencrypt/live/statista.steelforesight.ir mkdir -p "$DEST" cp -L "$LIVE/fullchain.pem" "$DEST/fullchain.pem" cp -L "$LIVE/privkey.pem" "$DEST/privkey.pem" chmod 644 "$DEST/fullchain.pem" chmod 600 "$DEST/privkey.pem" docker exec deploy-nginx-1 nginx -s reload