nginx and certbot into containers is start and renew certs by auto

This commit is contained in:
2025-05-31 19:54:35 +03:00
parent 81fd806691
commit 89d6d62f12
15 changed files with 433 additions and 345 deletions
+9 -12
View File
@@ -1,16 +1,13 @@
# certbot/Dockerfile
FROM certbot/certbot:latest
FROM certbot/certbot
# Опционально: можно установить дополнительные пакеты, если нужно
# RUN apk add --no-cache some-package
# Создаем директории для конфигов
RUN mkdir -p /etc/letsencrypt/config
# Копируем env файл (альтернатива - передавать через docker-compose)
# COPY .env /tmp/.env
# Копируем конфигурационные файлы
COPY config/certbot.ini /etc/letsencrypt/config/
COPY scripts/init-certbot.sh /opt/
# Копируем скрипт инициализации (если используется)
# COPY certbot-init.sh /opt/
# RUN chmod +x /opt/certbot-init.sh
# Устанавливаем права
RUN chmod +x /opt/init-certbot.sh
# Указываем точку входа (можно и через command в compose)
ENTRYPOINT ["sh", "-c"]
CMD ["certbot certonly --standalone --http-01-port ${CERTBOT_PORT} --noninteractive --agree-tos --email ${EMAIL} -d ${DOMAINS} --keep-until-expiring"]
ENTRYPOINT ["/opt/init-certbot.sh"]