Skip to content

Instantly share code, notes, and snippets.

@rafaelbiriba
Last active December 13, 2024 01:43
Show Gist options
  • Save rafaelbiriba/2771772f130dd0b6bbfef98b5a9001db to your computer and use it in GitHub Desktop.
Save rafaelbiriba/2771772f130dd0b6bbfef98b5a9001db to your computer and use it in GitHub Desktop.
Torrent Box - my docker-compose
# To download this file, use the following command:
# curl -o docker-compose.yml https://gist.githubusercontent.com/rafaelbiriba/2771772f130dd0b6bbfef98b5a9001db/raw/docker-compose.yml
version: "3.8"
services:
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
- TORRENTING_PORT=9992
volumes:
- /home/rafael/TorrentBox/config/qbittorrent:/config
- /home/rafael/TorrentBox/downloads:/downloads
ports:
- 8080:8080
- 9992:9992
- 9992:9992/udp
restart: unless-stopped
prowlarr:
image: lscr.io/linuxserver/prowlarr:latest
container_name: prowlarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
volumes:
- /home/rafael/TorrentBox/config/prowlarr:/config
ports:
- 9696:9696
restart: unless-stopped
sonarr:
image: lscr.io/linuxserver/sonarr:latest
container_name: sonarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
volumes:
- /home/rafael/TorrentBox/config/sonarr:/config
- /home/rafael/TorrentBox/media/tv:/tv
- /home/rafael/TorrentBox/downloads:/downloads
ports:
- 8989:8989
restart: unless-stopped
radarr:
image: lscr.io/linuxserver/radarr:latest
container_name: radarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
volumes:
- /home/rafael/TorrentBox/config/radarr:/config
- /home/rafael/TorrentBox/media/movies:/movies
- /home/rafael/TorrentBox/downloads:/downloads
ports:
- 7878:7878
restart: unless-stopped
bazarr:
image: lscr.io/linuxserver/bazarr:latest
container_name: bazarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
volumes:
- /home/rafael/TorrentBox/config/bazarr:/config
- /home/rafael/TorrentBox/media/movies:/movies
- /home/rafael/TorrentBox/media/tv:/tv
ports:
- 6767:6767
restart: unless-stopped
flaresolverr:
image: ghcr.io/flaresolverr/flaresolverr:latest
container_name: flaresolverr
environment:
- LOG_LEVEL=info
- LOG_HTML=false
- TZ=Europe/Berlin # Adjust timezone
ports:
- 8191:8191
restart: unless-stopped
#!/bin/bash
# Virtual Machine names
VM1="VM1"
VM2="VM2-with-encrypted-disk"
# Function to start VMs in headless mode
start_vms() {
echo "Starting VMs in headless mode..."
# Start VM1 without encryption password
VBoxManage startvm "$VM1" --type headless
echo "$VM1 started in headless mode."
# Start VM2 in headless mode
VBoxManage startvm "$VM2" --type headless
sleep 5
echo "$VM2 started in headless mode."
VBoxManage controlvm "$VM2" addencpassword "$VM2" -
}
# Function to stop VMs gracefully
stop_vms() {
echo "Stopping VMs gracefully..."
VBoxManage controlvm "$VM1" acpipowerbutton
VBoxManage controlvm "$VM2" acpipowerbutton
echo "VMs are shutting down gracefully."
}
# Function to check the status of the VMs
status_vms() {
echo "Checking the status of the VMs..."
VM1_STATUS=$(VBoxManage list runningvms | grep -w "$VM1" | wc -l)
VM2_STATUS=$(VBoxManage list runningvms | grep -w "$VM2" | wc -l)
if [ "$VM1_STATUS" -eq 1 ]; then
echo "$VM1 is running."
else
echo "$VM1 is not running."
fi
if [ "$VM2_STATUS" -eq 1 ]; then
echo "$VM2 is running."
else
echo "$VM2 is not running."
fi
}
# Main script execution
case "$1" in
start)
start_vms
;;
stop)
stop_vms
;;
status)
status_vms
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment