Added healthcheck
This commit is contained in:
@@ -6,8 +6,8 @@ LABEL maintainer="quentin.mcgaw@gmail.com" \
|
|||||||
ram="11.89MB" \
|
ram="11.89MB" \
|
||||||
cpu_usage="Low to medium" \
|
cpu_usage="Low to medium" \
|
||||||
github="https://github.com/qdm12/private-internet-access-docker"
|
github="https://github.com/qdm12/private-internet-access-docker"
|
||||||
RUN apk add -q --progress --no-cache --update openvpn unbound && \
|
RUN apk add -q --progress --no-cache --update openvpn unbound ca-certificates wget && \
|
||||||
apk add -q --progress --no-cache --update --virtual=build-dependencies ca-certificates wget unzip && \
|
apk add -q --progress --no-cache --update --virtual=build-dependencies unzip && \
|
||||||
mkdir /openvpn-udp-normal /openvpn-udp-strong /openvpn-tcp-normal /openvpn-tcp-strong && \
|
mkdir /openvpn-udp-normal /openvpn-udp-strong /openvpn-tcp-normal /openvpn-tcp-strong && \
|
||||||
wget -q https://www.privateinternetaccess.com/openvpn/openvpn.zip \
|
wget -q https://www.privateinternetaccess.com/openvpn/openvpn.zip \
|
||||||
https://www.privateinternetaccess.com/openvpn/openvpn-strong.zip \
|
https://www.privateinternetaccess.com/openvpn/openvpn-strong.zip \
|
||||||
@@ -20,6 +20,7 @@ RUN apk add -q --progress --no-cache --update openvpn unbound && \
|
|||||||
apk del -q --progress --purge build-dependencies && \
|
apk del -q --progress --purge build-dependencies && \
|
||||||
rm -rf /*.zip /etc/unbound/unbound.conf /var/cache/apk/*
|
rm -rf /*.zip /etc/unbound/unbound.conf /var/cache/apk/*
|
||||||
COPY unbound.conf /etc/unbound/unbound.conf
|
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
|
||||||
ENV ENCRYPTION=strong \
|
ENV ENCRYPTION=strong \
|
||||||
PROTOCOL=tcp \
|
PROTOCOL=tcp \
|
||||||
REGION=Switzerland
|
REGION=Switzerland
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ It is based on:
|
|||||||
- [Alpine 3.7](https://alpinelinux.org)
|
- [Alpine 3.7](https://alpinelinux.org)
|
||||||
- [OpenVPN 2.4.5-r1](https://pkgs.alpinelinux.org/package/edge/main/ppc64le/openvpn)
|
- [OpenVPN 2.4.5-r1](https://pkgs.alpinelinux.org/package/edge/main/ppc64le/openvpn)
|
||||||
- [Unbound 1.7.0-r2](https://pkgs.alpinelinux.org/package/edge/main/aarch64/unbound)
|
- [Unbound 1.7.0-r2](https://pkgs.alpinelinux.org/package/edge/main/aarch64/unbound)
|
||||||
|
- wget and ca-certificates for the healthcheck
|
||||||
|
|
||||||
It requires:
|
It requires:
|
||||||
- A Private Internet Access **username** and **password** - [Sign up](https://www.privateinternetaccess.com/pages/buy-vpn/)
|
- A Private Internet Access **username** and **password** - [Sign up](https://www.privateinternetaccess.com/pages/buy-vpn/)
|
||||||
@@ -107,6 +108,11 @@ Cloudflare **DNS 1.1.1.1 over TLS** is used to connect to any PIA server for mul
|
|||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
|
1. Note that you can simply use the HEALTCHECK provided. The container will stop by itself
|
||||||
|
if the VPN IP is the same as your initial public IP address.
|
||||||
|
|
||||||
|
Otherwise you can follow these instructions:
|
||||||
|
|
||||||
1. Check your host IP address with:
|
1. Check your host IP address with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
printf "Changing DNS to localhost..."
|
printf "\nDetecting current public IP address..."
|
||||||
|
export INITIALIP=$(wget -qO- -T 2 https://api.ipify.org)
|
||||||
|
printf "$INITIALIP\nChanging DNS to localhost..."
|
||||||
echo "nameserver 127.0.0.1" > /etc/resolv.conf
|
echo "nameserver 127.0.0.1" > /etc/resolv.conf
|
||||||
echo "options ndots:0" >> /etc/resolv.conf
|
echo "options ndots:0" >> /etc/resolv.conf
|
||||||
printf "DONE\nStarting Unbound to connect to Cloudflare DNS 1.1.1.1 at its TLS endpoint TCP 853..."
|
printf "DONE\nStarting Unbound to connect to Cloudflare DNS 1.1.1.1 at its TLS endpoint TCP 853..."
|
||||||
|
|||||||
Reference in New Issue
Block a user