playit-cloud / playit-agent

The playit program
BSD 2-Clause "Simplified" License
259 stars 21 forks source link

Use Docker's chmod flag in copy and made playit no longer run as root. #96

Open kevinf100 opened 3 months ago

kevinf100 commented 3 months ago

As discussed in https://github.com/playit-cloud/playit-agent/pull/94 Playit will now run without root and has it USER set to non-root. The following in the Dockerfile allows users to change the ID. ARG PLAYIT_GUID=2000 ARG PLAYIT_UUID=2000 https://docs.docker.com/build/guide/build-args/ https://docs.docker.com/reference/compose-file/build/#args
Ignore https://github.com/playit-cloud/playit-agent/pull/95 , I didn't mess up at all and didn't copy the whole Dockerfile.

kevinf100 commented 3 months ago

Notice after that setting the user home changes that folder permission. Also adduser seemed to ignore that -M flag. Not sure whats up with that. This now has an empty folder in /home. Maybe sometime later, /home/playit can be used or -M will work.

kevinf100 commented 2 months ago

Added SIGTERM handler so the container stops sooner and so Playit can handle SIGTERM to exit gracefully (Assuming it can handle it already). Example