You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
# 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='3000'"
|
|
|