Allow configuration of uwsgi host and port in static image

via env vars `PDNS_ADMIN_STATIC_UWSGI_HOST` and `PDNS_ADMIN_STATIC_UWSGI_PORT`

Fixes #27
This commit is contained in:
Peter Schiffer 2023-12-19 20:50:59 +01:00
parent 5427e1e1fc
commit 0a615b25ca
No known key found for this signature in database
GPG key ID: F2A18AC34A008397
3 changed files with 11 additions and 2 deletions

View file

@ -4,8 +4,10 @@ RUN dnf -y --setopt=install_weak_deps=False install \
nginx \
&& dnf clean all
COPY pdns-nginx.conf.tpl docker-entrypoint.sh /
EXPOSE 80
COPY pdns-nginx.conf /etc/nginx/nginx.conf
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD [ "/usr/sbin/nginx", "-g", "daemon off;" ]

View file

@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
subvars --prefix 'PDNS_ADMIN_STATIC_' < /pdns-nginx.conf.tpl > /etc/nginx/nginx.conf
exec "$@"

View file

@ -45,7 +45,7 @@ http {
location @pdns_admin {
include uwsgi_params;
uwsgi_pass pdns-admin-uwsgi:9494;
uwsgi_pass {{ .PDNS_ADMIN_STATIC_UWSGI_HOST | default "pdns-admin-uwsgi" }}:{{ .PDNS_ADMIN_STATIC_UWSGI_PORT | default 9494 }};
}
error_page 404 /404.html;