initial
This commit is contained in:
commit
68610cc051
22
dockerfile
Normal file
22
dockerfile
Normal file
@ -0,0 +1,22 @@
|
||||
FROM alpine as build-pihole-exporter
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN apk update
|
||||
RUN apk add go
|
||||
|
||||
ENV GOPATH /build
|
||||
RUN go install github.com/eko/pihole-exporter@latest
|
||||
|
||||
FROM alpine
|
||||
COPY --from=build-pihole-exporter "/build/bin/pihole-exporter" /bin
|
||||
|
||||
RUN apk update
|
||||
run apk add bash
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
EXPOSE ${PORT}
|
||||
CMD ["/entrypoint.sh"]
|
||||
14
entrypoint.sh
Normal file
14
entrypoint.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
pihole_host=${PIHOLE:-pihole}
|
||||
pihole_pass=${PASS:-password1234}
|
||||
exporter_port=${PORT:-9617}
|
||||
|
||||
if [ -n "${PASS_FILE}" ] ; then
|
||||
pihole_pass=$(cat ${PASS_FILE})
|
||||
fi
|
||||
|
||||
exec /bin/pihole-exporter \
|
||||
-pihole_hostname ${pihole_host} \
|
||||
-pihole_password ${pihole_pass} \
|
||||
-port ${exporter_port}
|
||||
Loading…
Reference in New Issue
Block a user