From d264153f46b377e872fad0aaaec2f1eebd3995a9 Mon Sep 17 00:00:00 2001 From: valitovgaziz Date: Wed, 28 May 2025 13:12:12 +0300 Subject: [PATCH] add Dockerfile into certbot, hardcod the port for certbot into nginx.conf file --- certbot/Dockerfile | 16 ++++++++++++++++ nginx/configs/nginx.conf | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 certbot/Dockerfile diff --git a/certbot/Dockerfile b/certbot/Dockerfile new file mode 100644 index 0000000..6f0067e --- /dev/null +++ b/certbot/Dockerfile @@ -0,0 +1,16 @@ +# certbot/Dockerfile +FROM certbot/certbot:latest + +# Опционально: можно установить дополнительные пакеты, если нужно +# RUN apk add --no-cache some-package + +# Копируем env файл (альтернатива - передавать через docker-compose) +# COPY .env /tmp/.env + +# Копируем скрипт инициализации (если используется) +# COPY certbot-init.sh /opt/ +# RUN chmod +x /opt/certbot-init.sh + +# Указываем точку входа (можно и через command в compose) +ENTRYPOINT ["sh", "-c"] +CMD ["certbot certonly --standalone -p ${CERTBOT_PORT} --noninteractive --agree-tos --email ${EMAIL} -d ${DOMAINS} --keep-until-expiring"] diff --git a/nginx/configs/nginx.conf b/nginx/configs/nginx.conf index 1da69c3..4087409 100644 --- a/nginx/configs/nginx.conf +++ b/nginx/configs/nginx.conf @@ -58,7 +58,7 @@ server { # HTTP for certbot ssl certificate alterante port server { - listen ${CERTBOT_PORT}; # альтернативный порт для Certbot + listen 333; # альтернативный порт для Certbot location ~ /.well-known { allow all; }