Fix notebook directory permissions for non-root user

Pre-create /app/notebooks/{user,examples} with correct ownership
before switching to the spicebook user. Without this, the app crashes
with PermissionError when it tries to create these directories at
runtime.
This commit is contained in:
Ryan Malloy 2026-02-13 03:41:42 -07:00
parent a24375accb
commit 7ffd3f1bd3

View File

@ -46,7 +46,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system .
# Run as non-root
RUN useradd --create-home --shell /bin/bash spicebook
RUN useradd --create-home --shell /bin/bash spicebook && \
mkdir -p /app/notebooks/user /app/notebooks/examples && \
chown -R spicebook:spicebook /app/notebooks
USER spicebook
EXPOSE 8000