Hi,

I’m using docker-compose to host all my server services (jellyfin, qbittorrent, sonarr, etc.). I’ve recently grouped some of them into individual categories and then merged the individual docker-compose.yml file I had for each service into one per category. But is there actually any reason for not keeping them together?

The reason why is I’ve started configuring homepage and thought to myself “wouldn’t it be cool if instead of giving the server IP each time (per configured service in homepage) I’d just use the service name?” (AFAIK this only works if the containers are all in the same file).

  • czardestructo@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 year ago

    In case anyone cares here is my script, I use this for backups or shutting down the server.

    #!/bin/bash
    
    logger "Stopping Docker compose services"
    
    services=(/home/user/docker/*)    # This creates an array of the full paths to all subdirs
    #the last entry in this array is always blank line, hence the minus 1 in the for loop count below
    
    for ((i=0; i<=(${#services[@]}-1); i++))
    do
        docker compose -f ${services[i]}/docker-compose.yml down &
    done
    
    #wait for all the background commands to finish
    wait