|
|
|
FROM debian:stable-slim |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y openvpn easy-rsa iptables && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY openvpn-server.conf /etc/openvpn/server.conf |
|
|
|
|
|
RUN mkdir -p /etc/openvpn/pki && \ |
|
cp -r /usr/share/easy-rsa/* /etc/openvpn/pki && \ |
|
cd /etc/openvpn/pki && \ |
|
./easyrsa init-pki && \ |
|
./easyrsa --batch build-ca nopass && \ |
|
./easyrsa --batch gen-dh && \ |
|
./easyrsa --batch build-server-full server nopass && \ |
|
openvpn --genkey secret ta.key |
|
|
|
|
|
EXPOSE 1194/udp |
|
|
|
|
|
CMD ["openvpn", "--config", "/etc/openvpn/server.conf"] |