Files
cicd/playbooks/roles/nginx-reconfigure/files/docker_files/certbot/Dockerfile
2025-07-20 14:53:12 +03:00

20 lines
940 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#облегченный образ дебиан
FROM registry-1.docker.io/library/ubuntu:latest
LABEL authors="RONIS"
# Обновление и установка необходимых пакетов с последующей очисткой
RUN sed -i 's|http://archive.ubuntu.com|http://mirror.yandex.ru/ubuntu|' /etc/apt/sources.list && \
apt update && apt install -y certbot python3-certbot-nginx cron && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY check_and_create_cert.sh ./
# Проверка наличия сертификата для домена
RUN chmod +x ./check_and_create_cert.sh && echo "0 0 1 * * certbot renew --quiet" | tee -a /etc/crontab > /dev/null
# Запуск скрипта в контейнере при старте "& cron -f" обеспечивает запуск процесса для поддержки контейнера
CMD bash -c "./check_and_create_cert.sh & cron -f"