#Suggestions for how i could build an image for a private project on a homelab?

1 messages · Page 1 of 1 (latest)

little heath
#

Hey guys, i'm setting up a small homelab and wanted to run a small private discord bot (among other things).

Structure wise, I have a docker.py script that builds and mounts from a list of container names. So far, i've only set up third party services so like openspeedtest, where i can just get the image from docker hub.

I was hoping to host a private discord bot for me and my friends, but i want to keep it "private" in the sense that if i make the homelab repo public, the source code of my private projects is safe. At most there will be some folder called discord bot with a docker file or compose file using env variables. I was wondering if you guys have any suggestions of how you guys might handle deploying this?

The options i can think of so far:

-Dockerhub (I am 90% sure this is the way to go(?), but dockerhub only supports one private repository on the free tier. Are the below alternatives much worse?)

  • to have the git repo path for my discord bot as a env variable, and build it in a docker file on my homelab VM. (I assume this is second best option)
  • Prebuild the image locally, and send it to my homelab VM via ssh
  • Have a completely seperate git repo that my homelab VM references, which holds the source code for my private projects and all the deploy stuff.

Sorry to ask this guys i know its a dumb question, i would have just put the source code on the homelab VM for now and figure it out later, but if i make the repo public i assume the past commits are also public, so hoping to get it right early. I am also quite new to docker and all this 😅 🙏 Thank you very much in advance

pliant glen
#

just make a docker compose

little heath
#

in the discord bot repo itself?

pliant glen
#

You could also host gitea on your homelab and then have the docker compose clone from there (or use the integrated container registry)

#

Nah you would have:

  • discord bot repo on your gitea
  • docker image on your gitea
  • docker compose for your homelab
  • docker compose pulls down the image from your gitea
#

would probably be easiest (or you have a small docker file that is referenced by your docker compose, that docker file would then git clone as part of the build stage)

#

(gotta provide it with the git credentials for that tho)

little heath
# pliant glen Nah you would have: - discord bot repo on your gitea - docker image on your gite...

ah oke, thank you!🙏 I think i understand.

I'm not too familiar with gitea, but i looked it up just now, am i understanding it roughly correct?:

Develop the bot locally using github -> Gitea updates based on github (Or bypass github completely and push straight to gitea?) -> Gitea holds a seperate section for the image, so its not directly part of the discord bot repo on gitea -> homelab compose file references the gitea image like image:gitea/discord_bot:latest

And, is the benefit of using gitea over github that gitea has this image/container thing?

pliant glen
#

naaaa

#

gitea is like your local github

#

doesn't have to be gitea btw, just mentioned it because I have it in my homelab too

fervent iris
#

Github got container registry too

pliant glen
#

is it free too?

#

if github has free artifacts / container registry on private projects then you could just use that too

fervent iris
pliant glen
#

Doesn't seem like it, docker hub gives you one free image I guess

#

idk i like my local gitea instance

fervent iris
#

I think it's free for Github free tier for up to 500MB?

little heath
#

ahhhh oke, i think i understand.

So i'd have my homelab repo on github, which holds the "public stuff", and then the VM itself would have a private local gitea repo?

#

with the gitea route

pliant glen
#

I mean 2 ways

#

If you want the docker image to be stored somewhere remote:

  • bot repo on gitea
  • CI stuff on gitea to build the docker image after each push to the bot repo
  • homelab docker compose on github (public)
  • docker compose pulls the bot image from gitea
#

or:

  • public github repo for the homelab compose
  • private github repo for the bot
  • Dockerfile for the bot inside of the homelab repo (part of the build process is git cloning your private repo)
  • homelab repo builds the docker image using that dockerfile
little heath
#

Both make sense, i'm guessing you personally are doing the first one though right?

#

Super though, much clearer now. Thank you so much guys🙏 🙏 🙏

pliant glen