openvpn/Dockerfile

32 lines
719 B
Docker
Raw Permalink Normal View History

2023-05-16 19:36:21 +02:00
FROM debian:stable-slim
RUN apt update && apt dist-upgrade -y
2023-05-18 16:45:49 +02:00
RUN apt install -y openvpn openvpn-auth-ldap easy-rsa
2023-05-16 19:36:21 +02:00
2023-05-18 16:36:27 +02:00
WORKDIR /etc/openvpn
2023-05-16 19:36:21 +02:00
2023-05-18 16:45:49 +02:00
## Default Certificates - Not Production Use
## Documentation: https://wiki.archlinux.org/title/Easy-RSA
2023-05-16 19:36:21 +02:00
RUN make-cadir easy-rsa/
WORKDIR easy-rsa
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
2023-05-18 16:45:49 +02:00
RUN ./easyrsa gen-crl
2023-05-16 19:36:21 +02:00
2023-05-18 16:36:27 +02:00
COPY server.conf /etc/openvpn/server.conf
2023-05-16 19:36:21 +02:00
2023-05-18 16:36:27 +02:00
ADD entrypoint.sh /entrypoint.sh
2023-05-18 16:45:49 +02:00
VOLUME ["/etc/openvpn"]
2023-05-18 16:36:27 +02:00
ENTRYPOINT ["/entrypoint.sh"]
CMD ["openvpn","/etc/openvpn/server.conf"]