this post was submitted on 24 Jan 2025
8 points (83.3% liked)

Selfhosted

41554 readers
630 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I am wanting to automate some homelab things. Specifically deploying new and updating existing docker containers.

I would like to publish my entire docker compose stacks (minus env vars) onto a public Git repo, and then using something to select a specific compose from that, on a specific branch (so I can have a physical seperate server for testing) automatically deploy a container.

I thought of Jenkins, as it is quite flexable, and I am very willing to code it together, but are there any tools like this that I should look into instead? I've heard Ansible is not ideal for docker compose.

you are viewing a single comment's thread
view the rest of the comments
[–] damnthefilibuster@lemmy.world 2 points 6 days ago (1 children)

You wanna know a fun way to do this?

GitHub (and I think Gitlab too) supports you running their runner within your own infra. It’s literally a binary that needs permissions and space. Then, you can tell your git repo to use that runner to run docker compose and as part of the “build” process, deploy you container to the same or an in-network machine.

This is not secure, it’s probably going to involve a lot of hard coding of local IPs or server names etc. But you can make it work.

I use this way to get a Win11 PC to run some regular containers on itself. Works like a charm.

I did this and the fun thing about it is that your runner can access things inside your network that a regular GitLab runner can't. I've used it to manage a k8s cluster that isn't exposed to the Internet at all.