Changes:
- add config validation container to docker-compose
- add Make file with `up` and `down` commands
- add `default-http{,s}-port` commands to add_servers.py
- add nginx_conf.d directory usage for more than one custom nginx configurations
- rename `port` and `ssl_port` to `http{,s}_port` for templates
- add `https_custom_params` to templates
30 lines
817 B
Docker
30 lines
817 B
Docker
FROM python:3.11-alpine AS builder
|
|
|
|
RUN pip3 install --no-cache-dir pyyaml jinja2
|
|
|
|
COPY add_servers.py /add_servers.py
|
|
COPY servers.yaml /servers.yaml
|
|
COPY domains.txt /domains.txt
|
|
COPY nginx.conf.j2 /nginx.conf.j2
|
|
|
|
RUN python /add_servers.py --nginx-template /nginx.conf.j2 -o /nginx.conf --domains-list-txt /domains.txt --servers-config servers.yaml --certificates-path /ssl
|
|
|
|
# service
|
|
|
|
FROM nginx:alpine
|
|
|
|
RUN apk add curl bash
|
|
|
|
COPY --from=builder /nginx.conf /etc/nginx/nginx.conf
|
|
COPY nginx_conf.d /etc/nginx/conf.d
|
|
COPY domains.txt /domains.txt
|
|
|
|
RUN echo "20 2 */7 * * nginx -s reload" > /etc/crontabs/root && \
|
|
\
|
|
echo "cp /domains.txt /ssl/domains.txt" > /entrypoint && \
|
|
echo "crond" >> /entrypoint && \
|
|
echo "nginx -g 'daemon off;'" >> /entrypoint
|
|
|
|
ENTRYPOINT ["/bin/sh"]
|
|
CMD ["/entrypoint"]
|