Skip to content

Commit

Permalink
Update Dockerfile to adjust PDNS settings, add health check, expose a…
Browse files Browse the repository at this point in the history
…dditional ports, and perform clean up.
  • Loading branch information
nsouto committed Apr 30, 2024
1 parent 21e8f78 commit 6e714ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 6 additions & 4 deletions pdns-rec/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ RUN apk add --no-cache \
pdns-recursor~="${PDNS_VERSION}" \
py3-pip \
python3 \
drill && \
rm -rf /var/cache/apk/*
bind-tools \
drill

RUN pip3 install --no-cache-dir envtpl

ENV \
VERSION=${PDNS_VERSION} \
PDNS_daemon=no \
PDNS_setuid=recursor \
PDNS_setgid=recursor \
PDNS_setuid=pdns \
PDNS_setgid=pdns \
PDNS_local_port=53 \
PDNS_local_address=0.0.0.0 \
PDNS_config_dir=/etc/pdns \
Expand All @@ -34,6 +34,8 @@ COPY ./docker-entrypoint.sh /
# drill health.localhost.tld @localhost | grep -q 'rcode: NXDOMAIN' && \
# drill localhost @localhost | grep -q 'rcode: NOERROR'

RUN rm -rf /tmp/* /var/cache/apk/*

ENTRYPOINT [ "/docker-entrypoint.sh" ]

EXPOSE 53 53/udp
Expand Down
9 changes: 4 additions & 5 deletions pdns/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,9 @@ ENV \
PDNS_AUTH_max_queue_length=50000 \
PDNS_AUTH_zone_cache_refresh-interval=0 \
PDNS_AUTH_api=yes \
PDNS_AUTH_launch=gmysql:one,pipe \
PDNS_AUTH_webserver=yes \
PDNS_AUTH_webserver_address=0.0.0.0 \
PDNS_AUTH_webserver_allow_from=0.0.0.0/0,::/0 \
PDNS_AUTH_pipe_abi_version=3 \
PDNS_AUTH_pipe_command=/var/lib/powerdns/bin/default.pl \
PIPE_DEFAULT_IPV4=127.0.0.1 \
PIPE_DEFAULT_IPV6=::1 \
PIPE_DEFAULT_MX=localhost \
Expand All @@ -71,7 +68,7 @@ ENV \
PDNS_REC_setuid=pdns \
PDNS_REC_setgid=pdns \
PDNS_REC_local_port=5353 \
PDNS_REC_local_address=127.0.0.1 \
PDNS_REC_local_address=0.0.0.0 \
PDNS_REC_config_dir=/etc/pdns \
PDNS_REC_include_dir=/etc/pdns/recursor.d

Expand All @@ -91,6 +88,8 @@ RUN chmod +x /usr/local/bin/entrypoint.sh; \

RUN rm -rf /tmp/* /var/cache/apk/*

HEALTHCHECK --interval=10s --timeout=10s --retries=3 --start-period=2s CMD ["pdns_control", "ping"]

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

EXPOSE 53 53/udp
EXPOSE 53 53/udp 5353 5353/udp 8081

0 comments on commit 6e714ca

Please sign in to comment.