deranjer / goEDMS

golang/react EDMS for home users
MIT License
7 stars 2 forks source link

I created a docker-compose file for those of us that use them #5

Closed zombiehoffa closed 2 years ago

zombiehoffa commented 4 years ago

You can put the below in a file, update the volume locations and run docker-compose -f whateveryoucalledthefile.yml up -d on it for ease of recreating for those of use that do that. As a side note for the creator, it would be super awesome if you let us specify the uid and gid for the container to run as as an environment variable like they do in linuxserver containers. It'll make my life managing this docker on my server a lot easier. *edit, this thing really butchered the spacing and spacing is kind of important for this. Here's a pastebin: https://pastebin.com/EZAREw7f version: "3"

services: goedms: image: deranjer/goedms:latest container_name: goedms ports:

deranjer commented 4 years ago

I've added and tested the docker-compose file, seems to work fine, that will be in dist-specific-files on next push. However, I have no idea how to set the UID and GID for the container... I assume you mean the UID and GID of the goEDMS user in the image? I'm not sure how that works since the user is created by the dockerfile which is baked in right? I did some testing and I can change the UID and GID in the dockerfile and it will create the image, but overridding that with environment variables doesn't work (and I don't see how it could).

zombiehoffa commented 4 years ago

I'm not that familiar with the how for development (I basically know enough about docker to be a danger to myself and that's it, lol). I know linuxserver containers let you set the environment variables uid and gid which then makes everything in the container save/create files with that uid and gid, which matters a lot when you are mounting local drives from the local file system into the docker. I googled around and wonder if maybe they are using the environment variables to set the user option as described here: https://codeyarns.com/2017/07/21/how-to-set-user-of-docker-container/

deranjer commented 4 years ago

Yeah, so you CAN set a user for all exposed files/folders from the docker run command, but I'm not sure if that will mess things up for the goEDMS service. I can modify the dockerfile to set a specific UID/GID but that can't be changed by the docker run command, as far as I know. I think by default the goEDMS user is GID and UID of 1000. I'm not sure how they could possible change that via ENV variables for each run?

zombiehoffa commented 4 years ago

I did some more digging and came up with this: https://docs.linuxserver.io/general/understanding-puid-and-pgid

looks like they are using it to map the internal user to a user on the host machine, which makes sense to me based on the behavior it causes (files to have the right gid/uid where they are stored externally to work with stuff outside of docker)