diff --git a/Dockerfile b/Dockerfile index 6074477637..07b0e0667d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -184,6 +184,17 @@ COPY --chown=$UID:$GID --from=build /app/package.json /app/package.json # copy backend files COPY --chown=$UID:$GID ./backend . +# The backend rewrites its bundled static assets (favicons, splash, manifest, +# loader.js, ...) under open_webui/static at startup. Make that directory +# writable by an arbitrary UID -- which under OpenShift's restricted SCC is +# always a member of GID 0 -- so those writes don't fail with EACCES and crash +# the boot log with "[Errno 13] Permission denied". `chmod -R g=u` mirrors the +# owner bits onto the group (the Red Hat arbitrary-UID idiom). This is applied +# unconditionally because it targets a directory the app writes on every start; +# the broader, opt-in USE_PERMISSION_HARDENING below covers the rest of /app. +RUN chgrp -R 0 /app/backend/open_webui/static && \ + chmod -R g=u /app/backend/open_webui/static + EXPOSE 8080 HEALTHCHECK CMD curl --silent --fail http://localhost:${PORT:-8080}/health | jq -ne 'input.status == true' || exit 1