Testing the new docker-compose file

This commit is contained in:
Roger Gonzalez 2023-10-21 15:43:02 -03:00
parent 36f45d690f
commit 48b9205da6
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6
4 changed files with 80 additions and 62 deletions

11
.env.example Normal file
View File

@ -0,0 +1,11 @@
# Base configuration
PUID=<your_PUID>
PGID=<your_PGID>
MEDIA_FOLDER=<media_folder>
INSTALL_LOCATION=<install_location>
MEDIA_SERVICE=<media_service>
# VPN configuration
VPN_SERVICE=<vpn_service>
VPN_USER=<vpn_user>
VPN_PASSWORD=<vpn_password>

View File

@ -3,17 +3,17 @@ version: "3"
services: services:
# <media_service> is used to serve your media to the client devices # <media_service> is used to serve your media to the client devices
<media_service>: <media_service>:
image: lscr.io/linuxserver/<media_service> image: lscr.io/linuxserver/${MEDIA_SERVICE}
container_name: <media_service> container_name: ${MEDIA_SERVICE}
#network_mode: host # plex #network_mode: host # plex
environment: environment:
- PUID=<your_PUID> - PUID=${PUID}
- PGID=<your_PGID> - PGID=${PGID}
- VERSION=docker - VERSION=docker
volumes: volumes:
- <media_folder>/movies:/data/movies - ${MEDIA_FOLDER}/movies:/data/movies
- <media_folder>/tvshows:/data/tvshows - ${MEDIA_FOLDER}/tvshows:/data/tvshows
- <install_location>/config/<media_service>:/config - ${INSTALL_LOCATION}/config/${MEDIA_SERVICE}:/config
ports: ports:
- 8096:8096 - 8096:8096
restart: unless-stopped restart: unless-stopped
@ -23,12 +23,12 @@ services:
image: lscr.io/linuxserver/qbittorrent image: lscr.io/linuxserver/qbittorrent
container_name: qbittorrent container_name: qbittorrent
environment: environment:
- PUID=<your_PUID> - PUID=${PUID}
- PGID=<your_PGID> - PGID=${PGID}
- WEB_UI_PORT=8080 - WEB_UI_PORT=8080
volumes: volumes:
- <media_folder>/downloads:/downloads - ${MEDIA_FOLDER}/downloads:/downloads
- <install_location>/config/qbittorrent:/config - ${INSTALL_LOCATION}/config/qbittorrent:/config
restart: unless-stopped restart: unless-stopped
ports: # qbittorrent ports: # qbittorrent
- 8080:8080 # qbittorrent - 8080:8080 # qbittorrent
@ -40,12 +40,12 @@ services:
image: lscr.io/linuxserver/sonarr image: lscr.io/linuxserver/sonarr
container_name: sonarr container_name: sonarr
environment: environment:
- PUID=<your_PUID> - PUID=${PUID}
- PGID=<your_PGID> - PGID=${PGID}
volumes: volumes:
- <media_folder>/tvshows:/tv - ${MEDIA_FOLDER}/tvshows:/tv
- <media_folder>/downloads:/downloads - ${MEDIA_FOLDER}/downloads:/downloads
- <install_location>/config/sonarr:/config - ${INSTALL_LOCATION}/config/sonarr:/config
ports: ports:
- 8989:8989 - 8989:8989
restart: unless-stopped restart: unless-stopped
@ -56,12 +56,12 @@ services:
image: lscr.io/linuxserver/radarr image: lscr.io/linuxserver/radarr
container_name: radarr container_name: radarr
environment: environment:
- PUID=<your_PUID> - PUID=${PUID}
- PGID=<your_PGID> - PGID=${PGID}
volumes: volumes:
- <media_folder>/movies:/movies - ${MEDIA_FOLDER}/movies:/movies
- <media_folder>/downloads:/downloads - ${MEDIA_FOLDER}/downloads:/downloads
- <install_location>/config/radarr:/config - ${INSTALL_LOCATION}/config/radarr:/config
ports: ports:
- 7878:7878 - 7878:7878
restart: unless-stopped restart: unless-stopped
@ -72,12 +72,12 @@ services:
image: lscr.io/linuxserver/lidarr image: lscr.io/linuxserver/lidarr
container_name: lidarr container_name: lidarr
environment: environment:
- PUID=<your_PUID> - PUID=${PUID}
- PGID=<your_PGID> - PGID=${PGID}
volumes: volumes:
- <media_folder>/music:/music - ${MEDIA_FOLDER}/music:/music
- <media_folder>/downloads:/downloads - ${MEDIA_FOLDER}/downloads:/downloads
- <install_location>/config/lidarr:/config - ${INSTALL_LOCATION}/config/lidarr:/config
ports: ports:
- 8686:8686 - 8686:8686
restart: unless-stopped restart: unless-stopped
@ -88,12 +88,12 @@ services:
image: lscr.io/linuxserver/readarr:develop image: lscr.io/linuxserver/readarr:develop
container_name: readarr container_name: readarr
environment: environment:
- PUID=<your_PUID> - PUID=${PUID}
- PGID=<your_PGID> - PGID=${PGID}
volumes: volumes:
- <media_folder>/books:/books - ${MEDIA_FOLDER}/books:/books
- <media_folder>/downloads:/downloads - ${MEDIA_FOLDER}/downloads:/downloads
- <install_location>/config/readarr:/config - ${INSTALL_LOCATION}/config/readarr:/config
ports: ports:
- 8787:8787 - 8787:8787
restart: unless-stopped restart: unless-stopped
@ -104,12 +104,12 @@ services:
image: lscr.io/linuxserver/bazarr image: lscr.io/linuxserver/bazarr
container_name: bazarr container_name: bazarr
environment: environment:
- PUID=<your_PUID> - PUID=${PUID}
- PGID=<your_PGID> - PGID=${PGID}
volumes: volumes:
- <media_folder>/movies:/movies - ${MEDIA_FOLDER}/movies:/movies
- <media_folder>/tvshows:/tv - ${MEDIA_FOLDER}/tvshows:/tv
- <install_location>/config/bazarr:/config - ${INSTALL_LOCATION}/config/bazarr:/config
ports: ports:
- 6767:6767 - 6767:6767
restart: unless-stopped restart: unless-stopped
@ -120,10 +120,10 @@ services:
image: lscr.io/linuxserver/prowlarr image: lscr.io/linuxserver/prowlarr
container_name: prowlarr container_name: prowlarr
environment: environment:
- PUID=<your_PUID> - PUID=${PUID}
- PGID=<your_PGID> - PGID=${PGID}
volumes: volumes:
- <install_location>/config/prowlarr:/config - ${INSTALL_LOCATION}/config/prowlarr:/config
ports: ports:
- 9696:9696 - 9696:9696
restart: unless-stopped restart: unless-stopped
@ -142,12 +142,12 @@ services:
- 8388:8388/udp # Shadowsocks - 8388:8388/udp # Shadowsocks
#- 8080:8080/tcp # gluetun #- 8080:8080/tcp # gluetun
volumes: volumes:
- <install_location>/config/gluetun:/config - ${INSTALL_LOCATION}/config/gluetun:/config
environment: environment:
- VPN_SERVICE_PROVIDER=<vpn_service> - VPN_SERVICE_PROVIDER=${VPN_SERVICE}
- VPN_TYPE=openvpn - VPN_TYPE=openvpn
- OPENVPN_USER=<vpn_user> - OPENVPN_USER=${VPN_USER}
- OPENVPN_PASSWORD=<vpn_password> - OPENVPN_PASSWORD=${VPN_PASSWORD}
- OPENVPN_CIPHERS=AES-256-GCM - OPENVPN_CIPHERS=AES-256-GCM
restart: unless-stopped restart: unless-stopped
@ -160,7 +160,7 @@ services:
volumes: volumes:
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock:ro
- <install_location>/config/portainer:/data - ${INSTALL_LOCATION}/config/portainer:/data
restart: unless-stopped restart: unless-stopped
# Watchtower is going to keep our instances updated # Watchtower is going to keep our instances updated

View File

@ -180,6 +180,7 @@ install_location=${install_location:-/opt/yams}
[[ -f "$install_location" ]] || mkdir -p "$install_location" || send_error_message "There was an error with your install location! Make sure the directory exists and the user \"$USER\" has permissions on it" [[ -f "$install_location" ]] || mkdir -p "$install_location" || send_error_message "There was an error with your install location! Make sure the directory exists and the user \"$USER\" has permissions on it"
install_location=$(realpath "$install_location") install_location=$(realpath "$install_location")
filename="$install_location/docker-compose.yaml" filename="$install_location/docker-compose.yaml"
env_file="$install_location/.env"
read -p "What's the user that is going to own the media server files? [$USER]: " username read -p "What's the user that is going to own the media server files? [$USER]: " username
@ -316,6 +317,7 @@ echo ""
echo "Copying $filename..." echo "Copying $filename..."
cp docker-compose.example.yaml "$filename" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!" cp docker-compose.example.yaml "$filename" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!"
cp .env.example "$env_file" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!"
#+end_src #+end_src
** Set PUID, PGID, Media Folder, Media Service, Config folder and VPN ** Set PUID, PGID, Media Folder, Media Service, Config folder and VPN
@ -325,36 +327,33 @@ cp docker-compose.example.yaml "$filename" || send_error_message "Your user ($US
#+begin_src bash #+begin_src bash
# Set PUID # Set PUID
sed -i -e "s/<your_PUID>/$puid/g" "$filename" sed -i -e "s/<your_PUID>/$puid/g" "$env_file"
# Set PGID # Set PGID
sed -i -e "s/<your_PGID>/$pgid/g" "$filename" sed -i -e "s/<your_PGID>/$pgid/g" "$env_file"
# Set media_folder # Set media_folder
sed -i -e "s;<media_folder>;$media_folder;g" "$filename" sed -i -e "s;<media_folder>;$media_folder;g" "$env_file"
# Set media_service # Set media_service
sed -i -e "s;<media_service>;$media_service;g" "$env_file"
sed -i -e "s;<media_service>;$media_service;g" "$filename" sed -i -e "s;<media_service>;$media_service;g" "$filename"
if [ "$media_service" == "plex" ]; then if [ "$media_service" == "plex" ]; then
sed -i -e "s;#network_mode: host # plex;network_mode: host # plex;g" "$filename" sed -i -e "s;#network_mode: host # plex;network_mode: host # plex;g" "$filename"
fi fi
# Set config folder # Set config folder
sed -i -e "s;<install_location>;$install_location;g" "$filename" sed -i -e "s;<install_location>;$install_location;g" "$env_file"
# Set VPN # Set VPN
if [ "$setup_vpn" == "y" ]; then if [ "$setup_vpn" == "y" ]; then
sed -i -e "s;<vpn_service>;$vpn_service;g" "$filename" sed -i -e "s;<vpn_service>;$vpn_service;g" "$env_file"
sed -i -e "s;<vpn_user>;$vpn_user;g" "$filename" sed -i -e "s;<vpn_user>;$vpn_user;g" "$env_file"
sed -i -e "s;<vpn_country>;$vpn_country;g" "$filename" sed -i -e "s;<vpn_password>;$vpn_password;g" "$env_file"
sed -i -e "s;<vpn_password>;$vpn_password;g" "$filename"
sed -i -e "s;#network_mode: \"service:gluetun\";network_mode: \"service:gluetun\";g" "$filename" sed -i -e "s;#network_mode: \"service:gluetun\";network_mode: \"service:gluetun\";g" "$filename"
sed -i -e "s;ports: # qbittorrent;#port: # qbittorrent;g" "$filename" sed -i -e "s;ports: # qbittorrent;#port: # qbittorrent;g" "$filename"
sed -i -e "s;- 8080:8080 # qbittorrent;#- 8080:8080 # qbittorrent;g" "$filename" sed -i -e "s;- 8080:8080 # qbittorrent;#- 8080:8080 # qbittorrent;g" "$filename"
sed -i -e "s;#- 8080:8080/tcp # gluetun;- 8080:8080/tcp # gluetun;g" "$filename" sed -i -e "s;#- 8080:8080/tcp # gluetun;- 8080:8080/tcp # gluetun;g" "$filename"
if echo "nordvpn perfect privacy private internet access vyprvpn wevpn windscribe" | grep -qw "$vpn_service"; then
sed -i -e "s;SERVER_COUNTRIES;SERVER_REGIONS;g" "$filename"
fi
fi fi
#+end_src #+end_src

22
install.sh Executable file → Normal file
View File

@ -77,6 +77,7 @@ install_location=${install_location:-/opt/yams}
[[ -f "$install_location" ]] || mkdir -p "$install_location" || send_error_message "There was an error with your install location! Make sure the directory exists and the user \"$USER\" has permissions on it" [[ -f "$install_location" ]] || mkdir -p "$install_location" || send_error_message "There was an error with your install location! Make sure the directory exists and the user \"$USER\" has permissions on it"
install_location=$(realpath "$install_location") install_location=$(realpath "$install_location")
filename="$install_location/docker-compose.yaml" filename="$install_location/docker-compose.yaml"
env_file="$install_location/.env"
read -p "What's the user that is going to own the media server files? [$USER]: " username read -p "What's the user that is going to own the media server files? [$USER]: " username
@ -168,6 +169,11 @@ if [ "$setup_vpn" == "y" ]; then
fi fi
done done
echo echo
echo "What country do you want to use?"
echo "If you are using: NordVPN, Perfect Privacy, Private Internet Access, VyprVPN, WeVPN or Windscribe, then input a region"
read -p "You can check the countries/regions list for your VPN here: https://github.com/qdm12/gluetun/wiki/$vpn_service#servers [brazil]: " vpn_country
vpn_country=${vpn_country:-"brazil"}
fi fi
echo "Configuring the docker-compose file for the user \"$username\" on \"$install_location\"..." echo "Configuring the docker-compose file for the user \"$username\" on \"$install_location\"..."
@ -176,30 +182,32 @@ echo ""
echo "Copying $filename..." echo "Copying $filename..."
cp docker-compose.example.yaml "$filename" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!" cp docker-compose.example.yaml "$filename" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!"
cp .env.example "$env_file" || send_error_message "Your user ($USER) needs to have permissions on the installation folder!"
# Set PUID # Set PUID
sed -i -e "s/<your_PUID>/$puid/g" "$filename" sed -i -e "s/<your_PUID>/$puid/g" "$env_file"
# Set PGID # Set PGID
sed -i -e "s/<your_PGID>/$pgid/g" "$filename" sed -i -e "s/<your_PGID>/$pgid/g" "$env_file"
# Set media_folder # Set media_folder
sed -i -e "s;<media_folder>;$media_folder;g" "$filename" sed -i -e "s;<media_folder>;$media_folder;g" "$env_file"
# Set media_service # Set media_service
sed -i -e "s;<media_service>;$media_service;g" "$env_file"
sed -i -e "s;<media_service>;$media_service;g" "$filename" sed -i -e "s;<media_service>;$media_service;g" "$filename"
if [ "$media_service" == "plex" ]; then if [ "$media_service" == "plex" ]; then
sed -i -e "s;#network_mode: host # plex;network_mode: host # plex;g" "$filename" sed -i -e "s;#network_mode: host # plex;network_mode: host # plex;g" "$filename"
fi fi
# Set config folder # Set config folder
sed -i -e "s;<install_location>;$install_location;g" "$filename" sed -i -e "s;<install_location>;$install_location;g" "$env_file"
# Set VPN # Set VPN
if [ "$setup_vpn" == "y" ]; then if [ "$setup_vpn" == "y" ]; then
sed -i -e "s;<vpn_service>;$vpn_service;g" "$filename" sed -i -e "s;<vpn_service>;$vpn_service;g" "$env_file"
sed -i -e "s;<vpn_user>;$vpn_user;g" "$filename" sed -i -e "s;<vpn_user>;$vpn_user;g" "$env_file"
sed -i -e "s;<vpn_password>;$vpn_password;g" "$filename" sed -i -e "s;<vpn_password>;$vpn_password;g" "$env_file"
sed -i -e "s;#network_mode: \"service:gluetun\";network_mode: \"service:gluetun\";g" "$filename" sed -i -e "s;#network_mode: \"service:gluetun\";network_mode: \"service:gluetun\";g" "$filename"
sed -i -e "s;ports: # qbittorrent;#port: # qbittorrent;g" "$filename" sed -i -e "s;ports: # qbittorrent;#port: # qbittorrent;g" "$filename"
sed -i -e "s;- 8080:8080 # qbittorrent;#- 8080:8080 # qbittorrent;g" "$filename" sed -i -e "s;- 8080:8080 # qbittorrent;#- 8080:8080 # qbittorrent;g" "$filename"