#!/bin/bash # Define the path to the .env file (root-level) ENV_FILE="/mnt/docker/.env" # Base directory where the service Compose files are located COMPOSE_DIR="/mnt/docker/docker-compose.d" # List of service directories under docker-compose.d services=( "Documentation/bookstack.yml" "Documentation/gitea.yml" "Documentation/vaultwarden.yml" "Media/arr.yml" "Media/jellyfin.yml" "Media/shoko.yml" "Networking/gluetun.yml" "Networking/technitium.yml" "Networking/caddy.yml" "Tools/searxng.yml" "Tools/monerod.yml" "Tools/p2pool.yml" "Tools/ariang.yml" "Tools/nextcloud-aio.yml" ) # Start building the docker compose command with multiple -f flags COMPOSE_COMMAND="docker compose --env-file \"$ENV_FILE\"" # Loop through each service and append the -f flag for each compose file for service in "${services[@]}"; do COMPOSE_COMMAND+=" -f \"$COMPOSE_DIR/$service\"" done # Add the up command to the final docker compose command COMPOSE_COMMAND+=" up -d" # Execute the composed command eval $COMPOSE_COMMAND echo "All services have been started."