From 7ffd3f1bd30fc31ac5f98a7d2fc9392ad62d01dd Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Fri, 13 Feb 2026 03:41:42 -0700 Subject: [PATCH] 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. --- backend/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 5c679bc..061e541 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -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