openvpn/Dockerfile
2023-05-16 12:36:21 -05:00

25 lines
526 B
Docker

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']