Feature: add the possibility to disable a service

This commit is contained in:
Jean Froment 2021-01-31 19:11:51 +01:00
parent fab81f731d
commit 02e31585d9
3 changed files with 28 additions and 18 deletions

View File

@ -79,6 +79,11 @@ sudo su -c "mkdir /data && mkdir /data/config && mkdir /data/torrents"
Edit the `.env` file and change the variables as desired. Edit the `.env` file and change the variables as desired.
The variables are all self-explanatory. The variables are all self-explanatory.
**NEW**
You can also disable a service if you do not need it by editing the ``services.conf`` file.
Simply change the "*enable*" key with the "*disable*" one for the service you want to disable.
If you remove a line in this file, it will be considered as "enabled" as all services are enabled by default.
## Running & updating ## Running & updating
```sh ```sh

View File

@ -1,16 +1,15 @@
deluge:enable deluge: enable
plex:enable plex: enable
flaresolverr:enable flaresolverr: enable
jackett:enable jackett: enable
sonarr:enable sonarr: enable
radarr:enable radarr: enable
bazarr:enable bazarr: enable
lidarr:enable lidarr: enable
tautulli:enable tautulli: enable
jdownloader:enable jdownloader: enable
tdarr:enable tdarr: enable
nextcloud-db:enable nextcloud: enable
nextcloud:enable portainer: enable
portainer:enable netdata: enable
netdata:enable duplicati: enable
duplicati:enable

View File

@ -8,7 +8,12 @@ echo "${HTTP_USER}:${HTTP_PASSWORD}" > traefik/http_auth
COMPOSE_HTTP_TIMEOUT=240 COMPOSE_HTTP_TIMEOUT=240
# Fetch all YAML files # Fetch all YAML files
SERVICES=$(find services -mindepth 1 -maxdepth 1 -name "*.yaml" | sed -e 's/^/-f /') disabled_pattern=""
while read -r line ; do
disabled_pattern="${disabled_pattern} ! -name $line.yaml"
done < <(grep "disable" services.conf | awk -F : '{print $1}' )
SERVICES=$(find services -mindepth 1 -maxdepth 1 -name "*.yaml" ${disabled_pattern} | sed -e 's/^/-f /')
ALL_SERVICES="-f docker-compose.yaml $SERVICES" ALL_SERVICES="-f docker-compose.yaml $SERVICES"
echo "[$0] ***** Pulling all images... *****" echo "[$0] ***** Pulling all images... *****"
@ -16,7 +21,8 @@ docker-compose ${ALL_SERVICES} pull
echo "[$0] ***** Recreating containers if required... *****" echo "[$0] ***** Recreating containers if required... *****"
docker-compose ${ALL_SERVICES} up -d --remove-orphans docker-compose ${ALL_SERVICES} up -d --remove-orphans
echo "[$0] ***** Done updating containers *****" echo "[$0] ***** Done updating containers *****"
echo "[$0] ***** Clean unused images... *****" echo "[$0] ***** Clean unused images and volumes... *****"
docker image prune -af docker image prune -af
docker volume prune -f
echo "[$0] ***** Done! *****" echo "[$0] ***** Done! *****"
exit 0 exit 0