fix(web): ensure dataprotection-keys dir is owned by app user before switching USER
The volume mount /app/dataprotection-keys was created under root:root permissions on the host. When the container restarted with the 1.15.0 image, the non-root app user (uid=1654) could no longer read/write DataProtection keys, causing every request to fail with UnauthorizedAccessException and fall back to the generic /Error page. Add RUN chown during the final Docker stage so the directory ownership matches the runtime user before USER $APP_UID takes effect.
This commit is contained in:
@@ -20,6 +20,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble AS final
|
||||
WORKDIR /app
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends libgssapi-krb5-2 && rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=build /app/publish .
|
||||
RUN mkdir -p /app/dataprotection-keys && chown -R $APP_UID:$APP_UID /app/dataprotection-keys
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
EXPOSE 8080
|
||||
USER $APP_UID
|
||||
|
||||
Reference in New Issue
Block a user