Closed thejcpalma closed 5 months ago
Don't merge, Volume directive in docker resets permitions and ownership if you have VOLUME on dockerfile or a bind volume like in our compose example.
Don't merge
Okay i wont, but i have questions anyway, so i wouldnt have done it anyway instantly ^^
You write you updated only volumes, but you added a lot of envs and args also you install "inotify-tools".
We dont need thoose yet, or am i wrong?
Don't merge
Okay i wont, but i have questions anyway, so i wouldnt have done it anyway instantly ^^
You write you updated only volumes, but you added a lot of envs and args also you install "inotify-tools".
We dont need thoose yet, or am i wrong?
Preparing for my next pull request as to have abstraction to keep all the vars and paths in one place. No need yet.
Just kill this PR and I'll introduce this in the next one
Fix Volume Permissions
Summary
This PR adds the
entrypoint.sh
script to change the ownership of the/palworld
directory to thesteam
user and ensures theservermanager.sh
script is run as thesteam
user.Motivation
The
/palworld
directory must be owned by thesteam
user to ensure the game server operates correctly. Running theservermanager.sh
script as thesteam
user maintains the expected behavior without introducing new issues, eliminating the need for commands likechown -R 1000:1000 game/
orchmod 777 game
.Changes
/palworld
directory from the Dockerfile as it's unnecessary due to theVOLUME
directive.servermanager.sh
toentrypoint.sh
in the Dockerfile to facilitate the fix.USER steam
to ensureentrypoint.sh
runs asroot
(allows for the ownership change without getting permission denied).CMD
in the Dockerfile withENTRYPOINT
to ensure theentrypoint.sh
script always runs when the container starts. See Explanation for more details.entrypoint.sh
script to change the ownership of the/palworld
directory to thesteam
user and run theservermanager.sh
script as thesteam
user.Testing
The changes were validated by building the Docker image locally and running a container with the updated
entrypoint.sh
script. The ownership of the/palworld
directory was confirmed to be thesteam
user, and the game server was successfully started using theservermanager.sh
script.Additional Information
Fixes #145