Healthcheck searches for city and organization of public IP

This commit is contained in:
Quentin McGaw
2018-04-16 14:19:35 -04:00
parent dd99f7e306
commit 73c5fe5b2a
2 changed files with 11 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ LABEL maintainer="quentin.mcgaw@gmail.com" \
ram="11.89MB" \
cpu_usage="Low to medium" \
github="https://github.com/qdm12/private-internet-access-docker"
RUN apk add -q --progress --no-cache --update openvpn unbound ca-certificates wget && \
RUN apk add -q --progress --no-cache --update openvpn unbound ca-certificates && \
apk add -q --progress --no-cache --update --virtual=build-dependencies unzip && \
mkdir /openvpn-udp-normal /openvpn-udp-strong /openvpn-tcp-normal /openvpn-tcp-strong && \
wget -q https://www.privateinternetaccess.com/openvpn/openvpn.zip \
@@ -20,7 +20,11 @@ RUN apk add -q --progress --no-cache --update openvpn unbound ca-certificates wg
apk del -q --progress --purge build-dependencies && \
rm -rf /*.zip /etc/unbound/unbound.conf /var/cache/apk/*
COPY unbound.conf /etc/unbound/unbound.conf
HEALTHCHECK --interval=10m --timeout=3s --start-period=5s --retries=1 CMD [ $(wget -qO- -T 2 https://api.ipify.org) != "$INITIALIP" ] || exit 1
HEALTHCHECK --interval=10m --timeout=3s --start-period=5s --retries=1 \
CMD VPNCITY=$(wget -qO- -T 2 https://ipinfo.io/city); \
VPNORGANIZATION=$(wget -qO- -T 2 https://ipinfo.io/org); \
printf "\nCity: $VPNCITY\nOrganization: $VPNORGANIZATION"; \
[ "$VPNCITY" != "$CITY" ] || [ "$VPNORGANIZATION" != "$ORGANIZATION" ] || exit 1
ENV ENCRYPTION=strong \
PROTOCOL=tcp \
REGION=Switzerland