forked from siomiz/SoftEtherVPN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (31 loc) · 1.25 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
FROM alpine:3.17 as build
ENV LANG=en_US.UTF-8
ENV BUILD_VERSION=4.41-9782-beta
RUN apk add -U build-base ncurses-dev openssl-dev readline-dev zip zlib-dev \
&& wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/archive/v${BUILD_VERSION}.tar.gz \
&& mkdir -p /usr/local/src \
&& tar -x -C /usr/local/src/ -f v${BUILD_VERSION}.tar.gz \
&& rm v${BUILD_VERSION}.tar.gz \
&& cd /usr/local/src/SoftEtherVPN_Stable-* \
&& ./configure \
&& make \
&& make install \
&& touch /usr/vpnserver/vpn_server.config \
&& zip -r9 /artifacts.zip /usr/vpn* /usr/bin/vpn*
FROM alpine:3.17
COPY --from=build /artifacts.zip /
COPY copyables /
ENV LANG=en_US.UTF-8
RUN apk add -U --no-cache bash iptables openssl-dev \
&& chmod +x /entrypoint.sh /gencert.sh \
&& unzip -o /artifacts.zip -d / \
&& rm /artifacts.zip \
&& rm -rf /opt \
&& ln -s /usr/vpnserver /opt \
&& find /usr/bin/vpn* -type f ! -name vpnserver \
-exec sh -c 'ln -s {} /opt/$(basename {})' \;
WORKDIR /usr/vpnserver/
VOLUME ["/usr/vpnserver/server_log/", "/usr/vpnserver/packet_log/", "/usr/vpnserver/security_log/"]
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 500/udp 4500/udp 1701/tcp 1194/udp 5555/tcp 443/tcp
CMD ["/usr/bin/vpnserver", "execsvc"]