File size: 757 Bytes
f7962c7 6b67f24 e501224 f7962c7 e501224 6b67f24 e38c330 6b67f24 e38c330 6b67f24 e501224 d6fe2aa e501224 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# 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"] |