forked from conlon/pia-openvpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (39 loc) · 1.41 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM alpine:latest
RUN apk -U upgrade && \
apk add --no-cache openvpn curl bash jq sed && \
#
#AES256 encryption profiles
curl -o /openvpn-strong.zip https://www.privateinternetaccess.com/openvpn/openvpn-strong.zip && \
mkdir /etc/openvpn/pia-strong && \
unzip -d /etc/openvpn/pia-strong/ /openvpn-strong.zip && \
#AES128 encryption profiles
curl -o /openvpn.zip https://www.privateinternetaccess.com/openvpn/openvpn.zip && \
mkdir /etc/openvpn/pia-standard && \
unzip -d /etc/openvpn/pia-standard/ /openvpn.zip && \
#
# cleanup temporary files
rm -rf /tmp/* && \
rm /openvpn.zip && \
rm /openvpn-strong.zip && \
rm -rf /var/cache/apk/* && \
mkdir /portforward && \
touch /portforward/port.txt && \
chmod -R 777 /portforward
#echo net.ipv4.ip_forward=1 > /etc/sysctl.d/10-port-forward.conf
COPY openvpn.sh /usr/local/bin/openvpn.sh
COPY up.sh /etc/openvpn
COPY up2.sh /etc/openvpn
COPY pia_portforward.sh /etc/openvpn
COPY down.sh /etc/openvpn
COPY port-refresh.sh /etc/openvpn
COPY cron.hourly/* /etc/periodic/hourly/
RUN chmod a+rx /etc/openvpn/*.sh && chmod -R a+rx /etc/periodic/hourly/
WORKDIR /etc/openvpn
ENV REGION="France"
ENV STRONG_ENCRYPT=""
HEALTHCHECK --interval=60s --timeout=15s --start-period=120s \
CMD curl -L 'https://api.ipify.org'
VOLUME /portforward
EXPOSE 9091 9117
# 8989 7878 9117 5050 80 443 8080
ENTRYPOINT ["openvpn.sh"]