From 96c6efd7b782f1c7b7d97a00e9e46d7d5815210a Mon Sep 17 00:00:00 2001 From: Bertrand Date: Thu, 2 Jun 2022 12:52:07 +0000 Subject: [PATCH] Adding Gitea init script (Docker-compose+Nginx conf) --- gitea/docker-compose.yml | 23 +++++++++++++++++++++++ gitea/git.noobtoroot.xyz | 8 ++++++++ gitea/install.sh | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 gitea/docker-compose.yml create mode 100644 gitea/git.noobtoroot.xyz create mode 100644 gitea/install.sh diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml new file mode 100644 index 0000000..2f335fd --- /dev/null +++ b/gitea/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:1.16.8 + container_name: gitea + environment: + - USER_UID=1000 + - USER_GID=1000 + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3000:3000" + - "222:22" diff --git a/gitea/git.noobtoroot.xyz b/gitea/git.noobtoroot.xyz new file mode 100644 index 0000000..d35ff38 --- /dev/null +++ b/gitea/git.noobtoroot.xyz @@ -0,0 +1,8 @@ +server { + listen 80; + server_name git.noobtoroot.com; + + location / { + proxy_pass http://git.noobtoroot.xyz:3000; + } +} diff --git a/gitea/install.sh b/gitea/install.sh new file mode 100644 index 0000000..c13bb19 --- /dev/null +++ b/gitea/install.sh @@ -0,0 +1,35 @@ +# CHECK DEPENDENCIES +# { +#DOCKER +REQUIRED_PKG="docker" +PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed") +echo Checking for $REQUIRED_PKG: $PKG_OK +if [ "" = "$PKG_OK" ]; then + echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG." + sudo apt-get --yes install $REQUIRED_PKG +fi + +# DOCKER-COMPOSE +REQUIRED_PKG="docker-compose" +PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed") +echo Checking for $REQUIRED_PKG: $PKG_OK +if [ "" = "$PKG_OK" ]; then + echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG." + curl -L "https://github.com/docker/compose/releases/download/$(curl https://github.com/docker/compose/releases | grep -m1 '