diff --git a/Ubuntu.Dev.Kernel.Version.Compose.yaml b/Ubuntu.Dev.Kernel.Version.Compose.yaml new file mode 100644 index 0000000..3f8d1a2 --- /dev/null +++ b/Ubuntu.Dev.Kernel.Version.Compose.yaml @@ -0,0 +1,27 @@ +services: + wireguard-dashboard: + build: + context: . + dockerfile: Ubuntu.Dev.Kernel.Version.Dockerfile + #image: donaldzou/wgdashboard:latest + restart: unless-stopped + container_name: wgdashboard + #environment: + #- tz= # <--- Set container timezone, default: Europe/Amsterdam. + #- global_dns= # <--- Set global DNS address, default: 1.1.1.1. + #- isolate= # <--- Set the interfaces that will disallow peer communication, default: 'none'. + #- public_ip= # <--- Set public IP to ensure the correct one is chosen, defaulting to the IP give by ifconfig.me. + ports: + - 10086:10086/tcp + - 51820:51820/udp + volumes: + - conf:/etc/wireguard + - data:/data + cap_add: + - NET_ADMIN + devices: + - /dev/net/tun:/dev/net/tun + +volumes: + conf: + data: diff --git a/Ubuntu.Dev.Kernel.Version.Dockerfile b/Ubuntu.Dev.Kernel.Version.Dockerfile new file mode 100644 index 0000000..8179248 --- /dev/null +++ b/Ubuntu.Dev.Kernel.Version.Dockerfile @@ -0,0 +1,30 @@ +FROM ubuntu:jammy +WORKDIR /WGDashboard +ENV TZ=UTC +EXPOSE 10086 +COPY ./src /WGDashboard/ + +RUN cp -f /etc/apt/sources.list /etc/apt/sources.list.backup && \ + sed "s/# deb-src/deb-src/" /etc/apt/sources.list.backup > /etc/apt/sources.list && \ + apt-get update -y && \ + apt-get upgrade -y && \ + apt-get install wireguard sudo python3 python3-venv python3-pip net-tools -y && \ + apt install iproute2 -y && \ + apt install -y software-properties-common python3-launchpadlib gnupg2 && add-apt-repository ppa:amnezia/ppa -y && \ + sudo apt-get install -y amneziawg && \ + mkdir -p /etc/amnezia/amneziawg + +# Copy AmneziaWG binaries +COPY entrypoint.sh /WGDashboard/entrypoint.sh + +# Install necessary tools and libraries in the final image +RUN chmod +x /WGDashboard/wgd.sh && chmod +x /WGDashboard/entrypoint.sh + +RUN if [ ! -c /dev/net/tun ]; then \ + mkdir -p /dev/net && mknod /dev/net/tun c 10 200; \ +fi + + +RUN ./wgd.sh install +# Start the script and keep it alive by tailing the logs +CMD ["/bin/bash", "-c", "/WGDashboard/wgd.sh start && tail -f /dev/null"] \ No newline at end of file