From 065fcc4be3ca0e51361dcf19635ee911e69b0fe2 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Sat, 19 Oct 2024 20:58:05 +0530 Subject: [PATCH] Added wireguard tunnel config in docker-compose and removed docker compose up from setup.sh --- docker-compose.yaml | 24 ++++++++++++++++++++++++ setup.sh | 7 ++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 850e78d..907a760 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -22,6 +22,30 @@ services: networks: - ntfy + wg-easy: + container_name: tunnel + image: ghcr.io/wg-easy/wg-easy + restart: unless-stopped + environment: + - PASSWORD_HASH=${PASS} + - WG_HOST=${IP} + volumes: + - ./config:/etc/wireguard + - /lib/modules:/lib/modules + ports: + - "51820:51820/udp" + - "51821:51821/tcp" + cap_add: + - NET_ADMIN + - SYS_MODULE + sysctls: + - net.ipv4.ip_forward=1 + - net.ipv4.conf.all.src_valid_mark=1 + env_file: + - .env + networks: + - ntfy + networks: ntfy: driver: bridge diff --git a/setup.sh b/setup.sh index efc6d3a..1922095 100644 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,6 @@ #!/bin/bash line="==================================" -PROJECT_DIR=/home/$(whoami)/iot-mini ############################################### @@ -40,5 +39,7 @@ sudo apt install -y python3-requests # For notifications ############################################### -cp main.py $PROJECT_DIR/ -cd $PROJECT_DIR +echo -e "$line\nSetting up Docker\n$line" +./docker-setup.sh +echo -e "$line\nDocker installation complete\n$line" +