How do y’all manage all these Docker compose apps?

First I installed Jellyfin natively on Debian, which was nice because everything just worked with the normal package manager and systemd.

Then, Navidrome wasn’t in the repos, but it’s a simple Go binary and provides a systemd unit file, so that was not so bad just downloading a new binary every now and then.

Then… Immich came… and forced me to use Docker compose… :|

Now I’m looking at Frigate… and it also requires Docker compose… :|

Looking through the docs, looks like Jellyfin, Navidrome, Immich, and Frigate all require/support Docker compose…

At this point, I’m wondering if I should switch everything to Docker compose so I can keep everything straight.

But, how do folks manage this mess? Is there an analogue to apt update, apt upgrade, systemctl restart, journalctl for all these Docker compose apps? Or do I have to individually manage each app? I guess I could write a bash script… but… is this what other people do?

  • LycaKnight@infosec.pub
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I use dockge. 1-2 years ago i started to selfhost everything with Docker. I have now 30+ Container and Dockge is absolut fantastic. I host all my stuff on a root Server from Hetzner and if they reveal a cheaper Server i switch. Since all my Stuff is hosted on Docker i can simple copy it to the new Server and start the Docker Containers and it runs.

    https://github.com/louislam/dockge

  • JASN_DE@feddit.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    2 months ago

    Check out Dockge. It provides a simple yet very usable and useful web UI for managing Docker compose stacks.

    • ook@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Was looking if anyone mentioned it!

      I started with portainer but it was way too complex for my small setup. Dockge works super well, starting, stopping, updating containers in a simple web interface.

      Just updating Dockge itself from inside Dockge does not seem to work but to be fair I didn’t look into it that much yet.

      • mbirth 🇬🇧@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        Can Dockge manage/cleanup unused images and containers by now? That’s the only reason I keep using Portainer - because it can show all the other stuff and lets me free up space.

        • Midnight Wolf@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          2 months ago

          No, not through the dockge UI. You can do it manually with standard docker commands (I have a cron task for this) but if you want to visualize things, dockge won’t do that (yet?).

  • UnityDevice@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I use quadlets instead - it’s part of podman and lets you manage containers as systemd services. Supports automatic image updates and gives you all the benefits of systemd service management. There’s a tool out there that will convert a docker compose config into quadlet unit files giving you a quick start, but I just write them by hand.

  • eksb@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I have 5 docker-compose-based services. I wrote a shell script:

    #!/usr/bin/env bash
    for y in $(find /etc/ -name docker-compose.yml); do
      cd $(dirname $y)
      docker compose pull
      systemctl resteart $y
    done
    
    • qqq@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      2 months ago

      For loops with find are evil for a lot of reasons, one of which is spaces:

      $ tree
      .
      ├── arent good with find loops
      │   ├── a
      │   └── innerdira
      │       └── docker-compose.yml
      └── dirs with spaces
          ├── b
          └── innerdirb
              └── docker-compose.yml
      
      3 directories, 2 files
      $ for y in $(find .); do echo $y; done
      .
      ./are
      t good with fi
      d loops
      ./are
      t good with fi
      d loops/i
      
      erdira
      ./are
      t good with fi
      d loops/i
      
      erdira/docker-compose.yml
      ./are
      t good with fi
      d loops/a
      ./dirs with spaces
      ./dirs with spaces/i
      
      erdirb
      ./dirs with spaces/i
      
      erdirb/docker-compose.yml
      ./dirs with spaces/b
      

      You can kinda fix that with IFS (this breaks if newlines are in the filename which would probably only happen in a malicious context):

      $ OIFS=$IFS
      $ IFS=$'\n'
      $ for y in $(find .); do echo "$y"; done
      .
      ./arent good with find loops
      ./arent good with find loops/innerdira
      ./arent good with find loops/innerdira/docker-compose.yml
      ./arent good with find loops/a
      ./dirs with spaces
      ./dirs with spaces/innerdirb
      ./dirs with spaces/innerdirb/docker-compose.yml
      ./dirs with spaces/b
      $ IFS=$OIFS
      

      But you can also use something like:

      find . -name 'docker-compose.yml' -printf '%h\0' | while read -r -d $'\0' dir; do
            ....
      done
      

      or in your case this could all be done from find alone:

      find . -name 'docker-compose.yml' -execdir ...
      

      -execdir in this case is basically replacing your cd $(dirname $y), which is also brittle when it comes to spaces and should be quoted: cd "$(dirname "$y")".

  • synae[he/him]@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I use k3s and argocd to keep everything synced to the configuration checked into a git repo. But I wouldn’t recommend that to someone just getting started with containers; kubernetes is a whole new beast to wrestle with.

      • synae[he/him]@lemmy.sdf.org
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        I use it for work so it felt natural to do it at home too. If anyone has time to learn it as a hobby and doesn’t mind a challenge, I recommend it. But IMO you need to already be familiar with a lot of containerization concepts

  • Chewy@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    2 months ago

    It won’t save you from doing a bit of work but you could use podman. There’s systemd integration so you can still start/stop/enable your services with systemctl while using docker/container images. You won’t be able to use docker-compose directly, but it’s usually not that hard to replicate the logic with systemd (Immich was a PITA at first (because they had so many microservices split into multiple images, but it improved considerably over the first two years).

    I do this with NixOS quite a bit, and I’ve yet to use docker compose (although the syntax is different, it’s still the same process).

  • TakenDistance@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I use Portainer (portainer.io) - it’s a prett nice WebUI which lets me manage the whole set of services and easily add new ones as you can edit the compose yaml right in the browser.

    There’s no substitute for knowing all the docker commands to help you get around but if you are looking for something to help with management then this might be the way to go.

    Watchtower also recommended is probably a good shout just be warned about auto upstating past your config - it’s super easy for the next image you pull to just break your setup because of new ENV or other dependency you’re not aware of.

  • Jakeroxs@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    It’s really nice once it’s going, especially if you link them together in a compose and farm out all the individual ymls for each service, or use something like dockage to do it.

  • frongt@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I just use watchtower to update automatically.

    Docker has a logs command.

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    Each app has a folder and then I have a bash script that runs

    Docker compose up -d 
    

    In each folder of my containers to update them. It is crude and will break something at some stage but meh jellyseer or TickDone being offline for a bit is fine while I debug.

    • Lka1988@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      2 months ago

      Same here. Dockge is also developed by the Watchtower dev.

      It’s so much easier to use than Portainer: no weird licensing shit, uses standard Docker locations, and works even with existing stacks. Also helps me keep Docker stacks organized - each compose.yaml lives in it’s own folder under /opt/stacks/.

      I have 4 VMs on my cluster specifically for Docker, each with it’s own Dockge instance, which can be linked together so that any Dockge instance in my cluster can access all Docker stacks over all the VMs.

    • village604@adultswim.fan
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Hmm, I wonder if I can use this on my Synology to manage things until I get around to finishing my proxmox setup.

    • Kyle@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      Wow thank you for this. This looks so much nicer than portainer.

      Subscribing to these communities is so helpful because of discovery like this.

  • tehWrapper@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I have finally had to switch to using docker for several things I use to just install manually (ttrss being the main one). It sure feels dirty when i use to just apt update and know everything was updated.

    I can see the draw for docker but feel it’s way over used right now.

      • tehWrapper@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        Docker pull lacks a lot of the automation apt has if your using multiple images, and needing to restart them.

        I’m an old man set in my ways… i see the benefit of docker and having set images, but also see so much waste having multi installs of the same thing for different docker images.

  • non_burglar@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I didn’t see ansible as a solution here, which I use. I run docker compose only. Each environment is backed up nightly and monitored. If a docker compose pull/up and then image clean breaks a service, I restore from a backup that works and see what went wrong.

  • HelloRoot@lemy.lol
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    2 months ago

    I manage them with dokploy.com

    I update them manually after checking if the update is beneficial to me.

    If not then why touch a running system?

  • Passerby6497@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    Docker compose pull; docker compose down;docker compose up -d

    Pulls an update for the container, stops the container and then restarts it in the background. I’ve been told that you don’t need to bring it down, but I do it so that even if there isn’t an update, it still restarts the container.

    You need to do it in each container’s folder, but it’s pretty easy to set an alias and just walk your running containers, or just script that process for each directory. If you’re smarter than I am, you could get the list from running containers (docker ps), but I didn’t name my service folders the same as the service name.

    • paequ2@lemmy.todayOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      What commands do you have to run after you update docker-compose.yml or .env files? I updated one of those files once bad things happened… I haven’t had to update the configs in a long time.

      • Passerby6497@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        I usually just do

        Docker compose down
        Docker compose up -d
        

        As I would with any service restart. The up -d command is supposed to reload it as well, but I prefer knowing for certain that the service restarted.

        Out of curiosity, what did you update and what broke? I had that happen a lot when I was first getting started with docker, and is part of how I learned. Once you have a basic template (or have dec supplies example files), it makes spinning up new services less of a hassle.

        Though I still get yelled at about the version entry in my fines because I haven’t touched mine in forever