Browse Source

Adding Gitea init script (Docker-compose+Nginx conf)

master
Bertrand Janvoie 3 years ago
parent
commit
96c6efd7b7
  1. 23
      gitea/docker-compose.yml
  2. 8
      gitea/git.noobtoroot.xyz
  3. 35
      gitea/install.sh

23
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"

8
gitea/git.noobtoroot.xyz

@ -0,0 +1,8 @@
server {
listen 80;
server_name git.noobtoroot.com;
location / {
proxy_pass http://git.noobtoroot.xyz:3000;
}
}

35
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 '<a href="/docker/compose/releases/download/' | grep -o 'v[0-9:].[0-9].[0-9]')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
fi
# }
# COPY NGINX CONF TO NGINX FOLDER
cp ./git.noobtoroot.xyz /etc/nginx/sites-available/
# CREATE A SYMBOLIQUE LINK FOR NGINX
ln -s /etc/nginx/sites-available/git.noobtoroot.xyz /etc/nginx/sites-enabled/
# INSTALL GITEA FROM DOCKER-COMPOSE FILE
docker-compose up -d
# USE CERTBOT FOR MAKE SSL CERTIFICATE
certbot --nginx -d git.noobtoroot.xyz
# DONE
echo "URL='git.noobtoroot.xyz' PORT='8000'"
Loading…
Cancel
Save