I am selfhosting Lemmy on a home Nomad cluster - I wrote the job files from scratch because I did not find anybody else who attempted the same.

I thought I’d share them and maybe they will serve as a starting point for someone using a similar selfhosted infra!

Nomad brings a few benefits from Lemmy specifically over Ansible/Docker, most notably some horizontal scaling across more than one machine.

Feedback welcome!

  • johntash@eviltoast.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    I’m also using nomad to run Lemmy, glad to see someone else is too! I did create separate jobs for each component though, and am using Traefik instead of nginx.

    What are you using for storage in your nomad cluster?

    • nico@r.dcotta.euOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      1 year ago

      Yep I am using traefik -> nginx. I simply add the traefik tags to the nginx service. I didn’t include that in the example file to keep it simple.

      As for the storage, I use SeaweedFS (has a CSI plugin, really cool, works well with nomad) but as a CSI volume it’s not suitable for backing postgres’ filesystem. The lookups are so noticeably slower that your Lemmy instance will be laggy. So I decided to use a normal host volume, so the DB writes to disk directly, and you can back that up to an S3-compatible storage with this (also cool). Could be SeaweedFS, AWS, Backblaze…

      I think SeaweedFS is suitable for your pictrs storage though, be it through its S3 API (supported by pictrs) or through a SeaweedFS CSI volume that stores the files directly.

      I hope that answers it! Do let me know what you end up with