feat: automatic ssl certificate

This commit is contained in:
Iain Learmonth 2025-04-27 17:52:40 +01:00
parent 6179dea246
commit 1007055da4
3 changed files with 62 additions and 4 deletions

View file

@ -4,6 +4,16 @@ RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-http
RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-cookie
RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-iputils
RUN apk add openssl
RUN /usr/local/openresty/luajit/bin/luarocks install lua-resty-auto-ssl
RUN mkdir /etc/resty-auto-ssl && chown -R nobody /etc/resty-auto-ssl
RUN openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 \
-subj '/CN=fallback.invalid' \
-keyout /etc/ssl/resty-auto-ssl-fallback.key \
-out /etc/ssl/resty-auto-ssl-fallback.crt
COPY default.conf /etc/nginx/conf.d/default.conf
COPY env.main /etc/nginx/conf.d/env.main
COPY lua/* /opt/sitelen-tu/