# Use the specified Debian image FROM debian:stable-slim # Install OpenVPN and Easy-RSA RUN apt-get update && \ apt-get install -y openvpn easy-rsa iptables && \ rm -rf /var/lib/apt/lists/* # Set up configuration files and keys COPY openvpn-server.conf /etc/openvpn/server.conf # Initialize Easy-RSA PKI 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 port 1194 for OpenVPN EXPOSE 1194/udp # Run OpenVPN server CMD ["openvpn", "--config", "/etc/openvpn/server.conf"]