7 Commits
Author SHA1 Message Date
Aleksei Sviridkin c2c6a8dd8f fix(entrypoint): reject an unusable PUID or PGID (#962)
A non-numeric PUID or PGID makes the [ -ne ] comparison error out, so usermod
is skipped and the app silently runs as the default UID 1000 instead of the
requested one. PUID 0 is worse: the container starts as root and drops to the
"app" user via gosu, so a PUID of 0 leaves that user at uid 0, the "am I still
root?" check never turns false, and the entrypoint re-execs itself forever.

Reject both up front with a clear message.

Assisted-By: Claude <noreply@anthropic.com>

Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-07-22 16:09:22 +02:00
Aleksei Sviridkin 5c5e8b44e1 fix(entrypoint): ignore Kubernetes service-link value in SPOOLMAN_PORT (#961)
Kubernetes sets a Docker-style service-link variable for every Service that
exists in the namespace when a pod starts, so a Service named "spoolman" makes
SPOOLMAN_PORT=tcp://<clusterIP>:8000 inside the container. That is the Service
address, not a port, and uvicorn refuses to start on it, so the pod crashloops
- seemingly at random, since it only happens when the Service predates the pod.

Ignore the service-link form and keep the default port.

Assisted-By: Claude <noreply@anthropic.com>

Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-07-21 22:30:21 +02:00
Joshua Piccari 388082f27a Tidy up docker file and entrypoint 2026-04-26 14:29:48 -07:00
Joshua Piccari 137558639a Add conditional logic to drop permissions for unprivileged Docker
This change enables the container to run in unprivileged mode (without
--privileged or additional capabilities) by making permission drops
conditional:

- Changed users group GID from 1000 to 1001 to avoid conflicts with
  the app user's primary group (UID 1000)
- Only modify user/group IDs when PUID/PGID environment variables differ
  from the default value of 1000, avoiding unnecessary privilege
  requirements
- Skip su-exec entirely when running as the default user, since changing
  user context requires additional capabilities that unprivileged
  containers don't have

This allows the container to work in restricted environments like
Kubernetes with security contexts or rootless Docker while maintaining
backward compatibility for users who customize PUID/PGID.

Fixes Donkie#791
2026-02-28 10:43:50 -08:00
Donkie 753140ecc3 Replaced su-exec with gosu, fixed pdm using wrong python version 2026-01-05 23:53:41 +01:00
hcooper 1273b20224 Support dynamic ports 2024-01-23 11:16:57 -08:00
Donkie 0be9ab5a8f Added PUID and PGID environment variable support 2023-12-29 11:18:25 +01:00