Changes: - add jinja2 template engine instead of string-replacing - fix certbot cron usage - replace json servers configuration with yaml
26 lines
700 B
Docker
26 lines
700 B
Docker
FROM python:3.10-alpine as builder
|
|
|
|
COPY add_servers.py /add_servers.py
|
|
COPY domains.txt /domains.txt
|
|
COPY nginx.conf /nginx.conf
|
|
|
|
RUN python /add_servers.py --nginx /nginx.conf --domains_list_txt /domains.txt --http-only
|
|
|
|
# service
|
|
|
|
FROM nginx:alpine
|
|
|
|
COPY proxy_common.conf /etc/nginx/proxy_common.conf
|
|
COPY server_common.conf /etc/nginx/server_common.conf
|
|
|
|
COPY --from=builder /nginx.conf /etc/nginx/nginx.conf
|
|
COPY domains.txt /domains.txt
|
|
|
|
RUN echo "(sleep 120 && killall nginx) &" > /entrypoint && \
|
|
echo "cp /domains.txt /ssl/domains.txt" >> /entrypoint && \
|
|
echo "nginx -g 'daemon off;'" >> /entrypoint && \
|
|
echo "nginx" >> /entrypoint
|
|
|
|
ENTRYPOINT ["/bin/sh"]
|
|
CMD ["/entrypoint"]
|