From 6419bf2cdfbb960bafd4490b81b0e50e06cda30c Mon Sep 17 00:00:00 2001 From: Lucas Daniel <94806303+NoodleLDS@users.noreply.github.com> Date: Wed, 3 Jun 2026 02:12:20 -0300 Subject: [PATCH] fix(docker): invoke setup.py on first container start (#1657) setup.py initialises auth.json and .env on a fresh install but was never called by the Docker entrypoint, leaving new deployments without admin credentials or a working config. Adds a single gosu-wrapped call to setup.py before the final exec drop. setup.py is fully idempotent (skips existing files) so subsequent starts are unaffected. || true ensures a setup failure never blocks the app from starting. Fixes #1476 --- docker/entrypoint.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index dede92f..668018a 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -80,6 +80,11 @@ export VLLM_USE_FLASHINFER_SAMPLER="${VLLM_USE_FLASHINFER_SAMPLER:-0}" # vLLM and helper scripts land here because /app is the non-root user's HOME. export PATH="/app/.local/bin:$PATH" +# Run first-time setup as the app user so data/ files get the right ownership. +# setup.py is idempotent — skips auth.json / .env if they already exist. +# || true so a setup failure never prevents the container from starting. +gosu "$PUID:$PGID" python /app/setup.py || true + # Drop root and run the actual app. `gosu` is preferred over `su` / # `sudo` because it cleans up the process tree (no extra shell layer) # so signals (SIGTERM from `docker stop`) reach uvicorn directly.