From eac6bf82a8655af7334235bc3c6713fee7789eb9 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Thu, 1 Aug 2024 23:17:03 +0200 Subject: [PATCH] Fix volume permissions I love docker --- Dockerfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c10c679..252278c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,8 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base + +# Make volume dirs +RUN for DIR in /database /manifest /builds; do mkdir $DIR; chown app: $DIR; done + USER $APP_UID WORKDIR /app EXPOSE 8080 @@ -19,9 +23,9 @@ FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "Robust.Cdn.dll"] -VOLUME /database -ENV CDN__DatabaseFileName=/database/content.db -VOLUME /manifest -ENV Manifest__DatabaseFileName=/manifest/manifest.db -VOLUME /builds + +VOLUME /database /manifest /builds + ENV Manifest__FileDiskPath=/builds +ENV Manifest__DatabaseFileName=/manifest/manifest.db +ENV CDN__DatabaseFileName=/database/content.db