Skip to content

Self-hosted AI workspace.

Python

fix(docker): invoke setup.py on first container start (#1657)

Lucas Daniel1de179601c7e
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index dede92ff8..668018ac1 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.