Update Dockerfile
Browse files- Dockerfile +23 -22
Dockerfile
CHANGED
@@ -1,24 +1,25 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
#
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
#
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
17 |
EXPOSE 1194/udp
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
ADD ./bin /usr/local/bin
|
22 |
-
RUN chmod a+x /usr/local/bin/*
|
23 |
-
|
24 |
-
# Add support for OTP authentication using a PAM module
|
|
|
1 |
+
FROM debian:stable-slim
|
2 |
+
|
3 |
+
# Install OpenVPN and Easy-RSA
|
4 |
+
RUN apt-get update && \
|
5 |
+
apt-get install -y openvpn easy-rsa iptables && \
|
6 |
+
rm -rf /var/lib/apt/lists/*
|
7 |
+
|
8 |
+
# Set up configuration files and keys
|
9 |
+
COPY ./openvpn-server.conf /etc/openvpn/server.conf
|
10 |
+
COPY ./vars /etc/openvpn/vars
|
11 |
+
|
12 |
+
# Initialize Easy-RSA PKI
|
13 |
+
RUN make-cadir /etc/openvpn/vars && \
|
14 |
+
cd /etc/openvpn/vars && \
|
15 |
+
. ./vars && \
|
16 |
+
./clean-all && \
|
17 |
+
./build-ca --batch && \
|
18 |
+
./build-key-server --batch server && \
|
19 |
+
./build-dh --batch
|
20 |
+
|
21 |
+
# Expose port 1194 for OpenVPN
|
22 |
EXPOSE 1194/udp
|
23 |
|
24 |
+
# Run OpenVPN server
|
25 |
+
CMD ["openvpn", "--config", "/etc/openvpn/server.conf"]
|
|
|
|
|
|
|
|