forked from edgd1er/nordvpn-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (43 loc) · 1.83 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
49
50
ARG VER=3.18
FROM alpine:${VER}
LABEL maintainer=edgd1er
ENV OVPN_CONFIG_DIR="/config" \
OPENVPN_LOGELEVEL=3 \
SERVER_RECOMMENDATIONS_URL="https://api.nordvpn.com/v1/servers/recommendations" \
SERVER_STATS_URL="https://nordvpn.com/api/server/stats/" \
CRON="*/15 * * * *" \
CRON_OVPN_FILES="@daily"\
NORDVPN_USER="**None**" \
NORDVPN_PASS="**None**" \
NORDVPN_COUNTRY="" \
NORDVPN_SERVER="" \
NORDVPN_CATEGORY="" \
NORDVPN_PROTOCOL="openvpn_tcp" \
LOAD=75 \
RANDOM_TOP="" \
LOCAL_NETWORK="" \
DANTE_PORT=1080 \
TINY_PORT=8888
EXPOSE ${DANTE_PORT}
EXPOSE ${TINY_PORT}
#hadolint ignore=DL3018
RUN echo "####### Installing packages #######" && \
echo "@community https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
apk --no-cache --update add bash bash-completion wget curl runit tzdata jq ip6tables ufw@community openvpn shadow \
bind-tools openssh dante-server ca-certificates unzip unbound socat vim tinyproxy && \
mkdir -p /openvpn/ -p /etc/service/openvpn /etc/service/dante /etc/service/crond /etc/service/unbound && \
touch /etc/service/dante/down /etc/service/unbound/down && \
curl -s https://www.internic.net/domain/named.cache -o /etc/unbound/root.hints && \
echo "####### Removing cache #######" && \
rm -rf /*.zip -- /var/cache/apk/*
COPY baseconfig /baseconfig/
COPY ./app /etc/service/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN echo "####### Changing permissions #######" && \
find /etc/service/ -type f -exec chmod u+x {} \; && \
touch /etc/service/unbound/down /etc/service/dante/down
HEALTHCHECK --interval=5m --timeout=20s --start-period=1m \
CMD if test $( curl -m 10 -s https://api.nordvpn.com/vpn/check/full | jq -r '.["status"]' ) = "Protected" ; then exit 0; else exit 1; fi
WORKDIR /etc/service
VOLUME /config/
CMD ["runsvdir", "/etc/service/"]