FROM registry.access.redhat.com/ubi9/ubi:latest

RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
 && dnf install -y openvpn easy-rsa iproute iptables \
 && dnf clean all \
 && rm -rf /var/cache/dnf

RUN mkdir -p /openvpn/pki /openvpn/state /etc/openvpn

STOPSIGNAL SIGTERM

CMD ["openvpn", "--config", "/config/server.conf"]