modified: certbot/Dockerfile

new file:   certbot/scripts/crontab.txt
	modified:   certbot/scripts/init-certbot.sh
Add crontab task file, add into build cront install command
This commit is contained in:
2025-07-19 17:50:36 +05:00
parent 1a2cfa2104
commit 24752ff05f
3 changed files with 24 additions and 1 deletions
+4
View File
@@ -1,5 +1,9 @@
FROM certbot/certbot
# Обновляем репозитории и устанавливаем cron
RUN apt-get update && \
apt-get install -y cron
# Создаем директории для конфигов
RUN mkdir -p /etc/letsencrypt/config
+1
View File
@@ -0,0 +1 @@
0 0 * * * root /opt/checkRenewCerts.sh > /proc/1/fd/1 2>&1
+19 -1
View File
@@ -25,4 +25,22 @@ if [ ! -d "/etc/letsencrypt/live/${DOMAINS_easysite102}" ]; then
--config /etc/letsencrypt/config/certbot.ini \
-w /var/www/certbot \
-d ${DOMAINS_easysite102}
fi
fi
set -e # Завершаем работу, если любая команда вернёт ошибку
# Установка Cron (если ещё не установлен)
if ! command -v cron &>/dev/null; then
echo "Cron not found, installing..."
apt-get update && apt-get install -y cron || true
fi
# Активируем сервис cron
service cron start
# Копируем нашу собственную crontab таблицу
cp /opt/crontab.txt /etc/crontabs/root
# Оставляем контейнер открытым
tail -f /dev/null