openvpn/Dockerfile

25 lines
526 B
Docker
Raw Normal View History

2023-05-16 19:36:21 +02:00
FROM debian:stable-slim
RUN apt update && apt dist-upgrade -y
RUN apt install -y openvpn openvpn-auth-ldap easy-rsa
ADD vars /etc/openvpn/vars
RUN make-cadir easy-rsa/
WORKDIR easy-rsa
COPY ./vars ./vars
RUN ./easyrsa init-pki
RUN export EASYRSA_BATCH=1 && ./easyrsa build-ca nopass
RUN export EASYRSA_BATCH=1 && ./easyrsa build-server-full server nopass
RUN ./easyrsa gen-dh
RUN openvpn --genkey secret /etc/openvpn/server/ta.key
ADD server.conf /etc/openvpn/server.conf
CMD ['openvpn','/etc/openvpn/server.conf']