jgwehr / homelab-docker

Docker Compose for building a home lab
106 stars 15 forks source link

README.md references a `/data` folder - what is it? #101

Closed micklynch closed 2 weeks ago

micklynch commented 2 months ago

Description

The README references a /data folder. https://github.com/jgwehr/homelab-docker/blob/bf4da8767e0639bf835583f24848a67e77faee3b/README.md?plain=1#L120

However, in the folder structure, this location does not exist. Is this something that needs to be created or is this supposed to reference /mnt/storage folder instead?

micklynch commented 2 months ago

And follow-up question, do I need to run everything as root?

jgwehr commented 2 months ago

Hi @micklynch - thanks for reaching out!

Is this something that needs to be created or is this supposed to reference /mnt/storage folder instead?

You found a mistake in the readme - I'll fix this as soon as I can. Until I can get this updated, the wiki may be a better reference: https://github.com/jgwehr/homelab-docker/wiki#install-steps Please ignore /data and instead use /mnt/storage. Please exercise caution with this, too. I think this instruction was from when I first started - so I haven't had a chance to verify if it still makes sense. And, of course, your particular contents/needs may require different permissions. My usage of mergerfs makes this a bit more confusing; but regardless it works.

The structure is based on TRaSH Guides, PerfectMediaServer, and Servarr docs.

And follow-up question, do I need to run everything as root?

This should not be necessary. I run everything rootless. It's been a while since setup and I did a (poorer) job documenting this area... I would start by assigning a non-root user to the docker group (wiki). Directories and files can be owned by user:docker (instead of user:user or root:root). Refer to this also: Rootless Docker.

If you have questions or find more places to improve the documentation, let me know! By end of week I'll be able to check what I actualy have running on the server and post a follow up for you.

micklynch commented 2 months ago

Thank you! I'll try to set it up this weekend and make a note of any inconsistencies. Are you open to accepting PRs? I can open one with changes that I feel are needed.

Another example, should all these env params also point to /mnt/storage? https://github.com/jgwehr/homelab-docker/blob/bf4da8767e0639bf835583f24848a67e77faee3b/.env.template#L15-L19

jgwehr commented 2 months ago

Good gracious, haha, yes they should. Feel free to PR if you have the time. I started this last night, and will be able to look closer over the weekend, also: https://github.com/jgwehr/homelab-docker/tree/maintenance/101-readmemd-references-a-data-folder-what-is-it

jgwehr commented 2 weeks ago

Sorry I've been very late responding - a few personal things slowing me down.

Here are the perms for /srv/docker - which is where I bind all my docker configs. The blurred users/groups are my user. Any inconsistencies here are unintentional. I don't understand linux perms as well as I want to, but I believe the ideal state is to have all of these owned by non-root-user:docker image

Similar explanation for the drives (note, storage is the mergerfs endpoint). Though, I'm more comfortable with these being owned by root:root. image

And again, within one of the drives. Poor hygiene on my part, but it works. image

Within the combined, mergerfs directory, all the directories used by docker are user:x image

There's a bit more info on this in a dusty issue here: https://github.com/jgwehr/homelab-docker/issues/21

I get mostly blanks when I run docker inspect $(docker ps -q) --format '{{.Config.User}} {{.Name}}' - but I do not use sudo when I execute docker compose up -d. All of these containers should show 1000:1000 aka the default user. This user has been added to the docker group.

micklynch commented 2 weeks ago

Thank you @jgwehr ! Very helpful. I have set-up the services that I need and it's up and running already, I don't use mergerfs. I'll read through you're comment to see if it improves anything. I'll need to wait until I have some tinkering time too..."if it ain't broke..." yadayada. Thanks for sharing this project, I definitely learned some cool stuff.