45 lines
1.2 KiB
Docker
45 lines
1.2 KiB
Docker
FROM ich777/debian-baseimage
|
|
|
|
LABEL org.opencontainers.image.authors="admin@minenet.at"
|
|
LABEL org.opencontainers.image.source="https://git.minenet.at/ich777/docker-wireguard-server"
|
|
|
|
RUN apt-get update && \
|
|
apt-get -y install --no-install-recommends wireguard iproute2 iptables iputils-ping sudo qrencode && \
|
|
rm -rf initrd.img initrd.img.old vmlinuz vmlinuz.old /boot && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN wget -O /tmp/gotty.tar.gz https://github.com/sorenisanerd/gotty/releases/download/v1.5.0/gotty_v1.5.0_linux_amd64.tar.gz && \
|
|
tar -C /usr/bin/ -xvf /tmp/gotty.tar.gz && \
|
|
rm -rf /tmp/gotty.tar.gz
|
|
|
|
ENV DATA_DIR="/wireguard"
|
|
ENV WG_CONFIG_ID=9
|
|
ENV SERVER_IP=YOURPUBLICIP
|
|
ENV SERVER_LISTEN_PORT=18215
|
|
ENV WG_NET_IP=10.50.0.1
|
|
ENV WG_NET_SUBNET=29
|
|
ENV PEERS=5
|
|
ENV GENERATE_PSK=true
|
|
ENV GENERATE_QR=true
|
|
ENV SETUP_IPTABLES=true
|
|
ENV NAT_DESTINATION="YOURIP:PORT"
|
|
ENV NAT_PROTOCOL="tcp"
|
|
ENV NAT_TUNNEL_PORT="PORT"
|
|
ENV ENABLE_WEBCONSOLE=true
|
|
ENV UMASK=000
|
|
ENV UID=99
|
|
ENV GID=100
|
|
ENV DATA_PERM=770
|
|
ENV USER="wireguard"
|
|
|
|
RUN mkdir $DATA_DIR && \
|
|
useradd -d $DATA_DIR -s /bin/bash $USER && \
|
|
chown -R $USER $DATA_DIR && \
|
|
ulimit -n 2048
|
|
|
|
ADD /scripts/ /opt/scripts/
|
|
|
|
RUN chmod -R 770 /opt/scripts/
|
|
|
|
#Server Start
|
|
ENTRYPOINT ["/opt/scripts/start.sh"] |