Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Proposal for docker-compose #25

Closed
takov751 opened this issue Mar 12, 2021 · 6 comments
Closed

Proposal for docker-compose #25

takov751 opened this issue Mar 12, 2021 · 6 comments

Comments

@takov751
Copy link

I created a fork to create a docker-compose example , and I am trying to figure out an easy maintainable solution permission wise.

https://github.com/takov751/LinuxGSM-Docker

So far what seems to be a promising solution for that is that we would run before starting up docker-compose
as in the description with one extra step
sudo groupadd -g 750 lgsm && sudo usermod -aG lgsm $USER
inside the docker-compose we could use the function called `group_add:

  • lgsm ` which would connect them together the group inside and outside of docker. So this way our user has group permission for the files of lgsm docker. I am waiting for feedback from those whom are more familiar with the LinuxGSM itself as I think there could be room for optimization in long term docker wise I mean. Great project and I already using the dockered version vhserver and it's working like a charm
@cmprinho
Copy link

I would have to test it, but is it possible to create groups and users in the Dockerfile? Afterwards you can switch using the USER docker statement and run the process as the given user. I think you should try to avoid running sudo commands.

@takov751
Copy link
Author

takov751 commented Mar 12, 2021

I tried that however it was causing permission issues as inside the docker user had no write permission . So really need some experiment . The whole Linuxgsm user specified. If there would be no user group specification in Dockerfile that might change things , would make your plan working , but that might break things inside LGSM

@clairmont32
Copy link
Contributor

clairmont32 commented Mar 13, 2021

The Dockerfile has a user and group created on line 86

groupadd -g 750 -o linuxgsm; \
adduser --uid 750 --disabled-password --gecos "" --ingroup linuxgsm linuxgsm; \
. I think starting the server install process may be doable by passing in another script and a .env for the users to fill out so when the container starts it'd automatically handle the user interaction for them but that concept would have to be proven out.

We're able to edit config files from inside the container since the PR to add vim to the image had been merged.

@takov751
Copy link
Author

takov751 commented Mar 14, 2021

@clairmont32 that is true , and even above all that we are already capable of using any editor as root with the same effect on host. Might be pointless to do indeed

@clairmont32
Copy link
Contributor

With the volume bind we can edit the configs under the user the container is started under on the host too. The changes made on the host will instantly reflect in the container but the game server still needs the initial, manual, interaction to be installed so we have access to those specific configs.

@clairmont32
Copy link
Contributor

@takov751 lets bring this convo over to #27 (comment) so we dont clutter the issues with our back and forth.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants