FROM ubuntu:22.04

RUN apt-get update && apt-get install -y \
    curl \
    wireguard-tools \
    iputils-ping \
    dnsutils \
    iproute2 \
    && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /etc/wireguard

RUN echo '[Interface]' > /etc/wireguard/wg0.conf && \
    echo 'PrivateKey = Tq9/VQ8qdsphS+0nVEFmWgFvMfvJ2FbWGK/Xt9cX4AA=' >> /etc/wireguard/wg0.conf && \
    echo 'Address = 10.8.0.2/32' >> /etc/wireguard/wg0.conf && \
    echo 'DNS = 1.1.1.1' >> /etc/wireguard/wg0.conf && \
    echo '' >> /etc/wireguard/wg0.conf && \
    echo '[Peer]' >> /etc/wireguard/wg0.conf && \
    echo 'PublicKey = 03qeK7CSn6wcMzfqilmVt6Tf81VZIPWnSG04euSkyxM=' >> /etc/wireguard/wg0.conf && \
    echo 'Endpoint = 149.88.104.2:51820' >> /etc/wireguard/wg0.conf && \
    echo 'AllowedIPs = 0.0.0.0/0' >> /etc/wireguard/wg0.conf && \
    echo 'PersistentKeepalive = 25' >> /etc/wireguard/wg0.conf

CMD tail -f /dev/null
