-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (25 loc) · 1.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM alpine
LABEL "Maintainer"="Remi Somdecoste-Lespoune <[email protected]>"
RUN apk --no-cache --no-progress add curl wget unzip openvpn && \
printf '#!/usr/bin/env sh\n/usr/local/bin/port_forward.sh &\n' > /usr/local/bin/up.sh && \
chmod +x /usr/local/bin/up.sh && \
wget https://www.privateinternetaccess.com/openvpn/openvpn.zip -P tmp/ && \
mkdir /config && \
unzip /tmp/openvpn.zip -d /config && \
sed -i 's/auth-user-pass.*/auth-user-pass credentials/' /config/*.ovpn && \
rm -rf /tmp/*
ENV REGION="France"
COPY port_forward.sh /usr/local/bin/port_forward.sh
HEALTHCHECK --interval=60s --timeout=15s --start-period=120s \
CMD curl -L 'https://api.ipify.org'
VOLUME ["/config/credentials"]
ENTRYPOINT openvpn \
--cd /config \
--config /config/${REGION}.ovpn \
--inactive 3600 \
--keepalive 10 60 \
--route-delay 2 \
--route-up "/sbin/ip route del default" \
--script-security 2 \
--up /usr/local/bin/up.sh \
--up-delay