Update
Browse files12 unmodified lines13141516161817181921202122232624282526271 unmodified line2930313236333435363738394012 unmodified lines
# ---------- app user ----------RUN groupadd -r appuser && useradd -m -r -g appuser -s /bin/bash appuserUSER appuser # ←─── switch early!
# ---------- directories & env ----------# ---------- cache directories & environment ----------ENV HOME=/home/appuserENV \ # Hugging-Face / transformers caches HF_HOME=$HOME/.cache \ HF_HUB_CACHE=$HOME/.cache/hub \ HUGGINGFACE_HUB_CACHE=$HOME/.cache/hub \ TRANSFORMERS_CACHE=$HOME/.cache/huggingface/hub \ # uv’s compilation / wheel cache UV_CACHE_DIR=$HOME/.cache/uv \ # python / app settings PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ UV_SYSTEM_PYTHON=1 \1 unmodified line PORT=${PORT} \ TRANSPORT_SERVER_URL=${TRANSPORT_SERVER_URL}
# create the caches while still root, then chown to appuserRUN mkdir -p "$HF_HUB_CACHE" "$TRANSFORMERS_CACHE" "$UV_CACHE_DIR"RUN mkdir -p "$HF_HUB_CACHE" "$TRANSFORMERS_CACHE" "$UV_CACHE_DIR" \ && chown -R appuser:appuser "$HOME/.cache"
# switch to non-root user (no inline comment!)USER appuser
# ---------- workdir ----------WORKDIR /appDockerfile+7-6