I set up a new home server recently using containerized services, and I wanted to share what I learned. Nothing here is revolutionary, but this is the type of resource I wish I had when I started.

I’m open to feedback on what I could have done better!

  • @skilltheamps@feddit.de
    link
    fedilink
    English
    32 years ago

    Do you do some sort of versioning/snapshotting of your services? I’m on the compose route as well, and have one btrfs subvolume per service that holds the compose.yml and all bind-mounted folders for perstistent data. That again gets regularly snapshotted by snapper.

    What leaves me a bit astounded is, that nobody seems to version the containers they are running. But without that, rolling back if something breaks might become a game of guessing the correct container version. I started building a tool that snapshots a service, then rewrites the image: in compose.yml to reflect what ever the current :latest tag resolves to. Surprisingly, there doesn’t seem to be an off-the-shelf solution for that…

    • @akdas@lemmy.worldOP
      link
      fedilink
      English
      12 years ago

      I don’t do a great job of this, but take Immich for example. There, I specify the version in the compose.yml (technically, the version is in the .env file and substituted into the compose.yml). At that point, updating Immich is a matter of updating the version number and restarting the service.

      These configuration files are all managed with git, so when I do these updates, I create a new commit. I just checked, and I have Forgejo pinned to a specific version in its compose.yml as well. But unfortunately, the other services are referencing :latest. I’m going to go back and pin them all :)

    • @NewDataEngineer@lemmy.world
      link
      fedilink
      English
      12 years ago

      How do you do that? I’m building a similar system now that automatically updates my containers. I’ve played around with the API and I can see which versions are attached to the latest sha265, but I can’t find a way to automatically tell which version it is. Especially when the same sha is linked to multiple versions

  • @Aux@lemmy.world
    link
    fedilink
    English
    22 years ago

    I would recommend using Ansible to manage your containers and infrastructure in general. It has quite a steep learning curve, but it’s worth it!

    • @akdas@lemmy.worldOP
      link
      fedilink
      English
      12 years ago

      Great suggestion! Someone else also suggested Ansible, so I’ll try it for the next service I set up. If it works out, I’ll publish another post on my experience :)

    • @akdas@lemmy.worldOP
      link
      fedilink
      English
      12 years ago

      I am familiar with tunnels in general, though I haven’t seen Cloudfare’s offering. I’m with the sibling comment that it’s another external dependency when my goal is to self host more. But that’s a tool I’ll keep in mind!

      I’ll have to check out Caddy plugins! One I saw called the docker command to discover exposed ports, meaning it depends on Docker explicitly. I’ll see what I can dig up wrt Podman. This sounds very interesting. Thanks!