Mbonea commited on
Commit
e501224
1 Parent(s): e145d09

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -22
Dockerfile CHANGED
@@ -1,24 +1,25 @@
1
- # Original credit: https://github.com/jpetazzo/dockvpn
2
-
3
- # Smallest base image
4
- FROM alpine:latest
5
-
6
- LABEL maintainer="Kyle Manna <kyle@kylemanna.com>"
7
-
8
- # Needed by scripts
9
- ENV OPENVPN=/etc/openvpn
10
- ENV EASYRSA=/usr/share/easy-rsa \
11
- EASYRSA_CRL_DAYS=3650 \
12
- EASYRSA_PKI=$OPENVPN/pki
13
-
14
- VOLUME ["/etc/openvpn"]
15
-
16
- # Internally uses port 1194/udp, remap using `docker run -p 443:1194/tcp`
 
 
 
 
 
17
  EXPOSE 1194/udp
18
 
19
- CMD ["ovpn_run"]
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"]