Dateien nach "/" hochladen

This commit is contained in:
M_Viper 2024-02-18 20:06:46 +00:00
parent 68485c8117
commit 172d171ce8
1 changed files with 55 additions and 0 deletions

55
docker.sh Normal file
View File

@ -0,0 +1,55 @@
#!/bin/bash
# Ermitteln der IP-Adresse des Servers
server_ip=$(hostname -I | awk '{print $1}')
# Installieren oder Aktualisieren von Docker
echo "Checking if Docker is installed..."
if command -v docker &>/dev/null; then
echo "Docker is already installed. Updating to the latest version..."
sudo apt update
sudo apt upgrade docker-ce -y
else
echo "Docker is not installed. Installing Docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
sudo systemctl start docker
sudo systemctl enable docker
rm get-docker.sh
fi
# Erstellen der erforderlichen Ordner an den richtigen Stellen
echo "Creating required directories..."
sudo mkdir -p /etc/pihole/
sudo mkdir -p /etc/dnsmasq.d/
sudo mkdir -p ~/pihole
sudo mkdir -p ~/dnsmasq.d
sudo mkdir -p ~/gitea
sudo mkdir -p ~/vaultwarden
# Pullen der neuesten Versionen der Docker-Images
echo "Pulling Docker images..."
sudo docker pull pihole/pihole
sudo docker pull rustdesk/rustdesk-server
sudo docker pull gardner/linkwarden
sudo docker pull linkstackorg/linkstack
sudo docker pull gitea/gitea
sudo docker pull vaultwarden/server
sudo docker pull portainer/portainer-ce
# Installieren und Starten der Docker-Container
echo "Installing and starting Docker containers..."
sudo docker run -d --name pihole -p 53:53/tcp -p 53:53/udp -p 80:80 -p 443:443 -e TZ="America/New_York" -e WEBPASSWORD="your_password" -v /etc/pihole/:/etc/pihole/ -v /etc/dnsmasq.d/:/etc/dnsmasq.d/ --restart=unless-stopped pihole/pihole
sudo docker run -d --name rustdesk -p 8080:80 rustdesk/rustdesk-server
sudo docker run -d --name linkwarden -p 3000:3000 gardner/linkwarden
sudo docker run -d --name linkstack -p 3030:3000 linkstackorg/linkstack
sudo docker run -d --name gitea -p 3000:3000 -p 222:22 -v ~/gitea:/data gitea/gitea
sudo docker run -d --name vaultwarden -p 80:80 -v ~/vaultwarden:/data vaultwarden/server
sudo docker run -d --name portainer -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer-ce
# Öffnen der Portainer-Seite im Browser
echo "Opening Portainer in browser..."
(xdg-open "http://$server_ip:9000" >/dev/null 2>&1 &) || (echo "Unable to open browser. Please navigate to http://$server_ip:9000 manually.")
echo "Docker and containers installed successfully."