fproxy-openvpn

This commit is contained in:
bel
2021-09-14 06:47:07 -06:00
parent 434c3dea0e
commit 22d354cbbd
11 changed files with 1476 additions and 0 deletions

23
fproxy-openvpn/Dockerfile Executable file
View File

@@ -0,0 +1,23 @@
FROM bel/fproxy:v0.4 as fproxy-carrier
FROM frolvlad/alpine-glibc:alpine-3.9_glibc-2.29
RUN apk add --update --no-cache openresolv openvpn iptables bash curl ca-certificates \
&& cd /etc/openvpn \
&& wget https://raw.githubusercontent.com/masterkorp/openvpn-update-resolv-conf/master/update-resolv-conf.sh \
&& chmod +x /etc/openvpn/update-resolv-conf.sh
RUN mkdir -p /conf
COPY ./*.ovpn /conf/
RUN for i in /conf/*; do \
echo 'script-security 2' >> $i; \
echo 'up /etc/openvpn/update-resolv-conf.sh' >> $i; \
echo 'down /etc/openvpn/update-resolv-conf.sh' >> $i; \
done
COPY --from=fproxy-carrier /main/exec-fproxy /fproxy
RUN echo 'if [ ! -e /mnt/default.ovpn ]; then cp $(ls /conf/*.ovpn | head -n 1) /mnt/default.ovpn; fi; openvpn /mnt/default.ovpn & /fproxy "$@"' > /entrypoint.sh
CMD []
ENTRYPOINT ["bash", "/entrypoint.sh"]