diff --git a/Moonlight/App/Services/MailService.cs b/Moonlight/App/Services/MailService.cs index 38482a2b..26764603 100644 --- a/Moonlight/App/Services/MailService.cs +++ b/Moonlight/App/Services/MailService.cs @@ -3,6 +3,7 @@ using System.Net.Mail; using Logging.Net; using Moonlight.App.Database.Entities; using Moonlight.App.Exceptions; +using Moonlight.App.Helpers; namespace Moonlight.App.Services; @@ -31,13 +32,13 @@ public class MailService Action> values ) { - if (!File.Exists($"resources/mail/{name}.html")) + if (!File.Exists(PathBuilder.File("storage", "resources", "mail", $"{name}.html"))) { Logger.Warn($"Mail template '{name}' not found. Make sure to place one in the resources folder"); throw new DisplayException("Mail template not found"); } - var rawHtml = await File.ReadAllTextAsync($"resources/mail/{name}.html"); + var rawHtml = await File.ReadAllTextAsync(PathBuilder.File("storage", "resources", "mail", $"{name}.html")); var val = new Dictionary(); values.Invoke(val); diff --git a/Moonlight/Dockerfile b/Moonlight/Dockerfile index 4fecfff7..f99a7334 100644 --- a/Moonlight/Dockerfile +++ b/Moonlight/Dockerfile @@ -19,6 +19,7 @@ RUN dotnet publish "Moonlight.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -RUN mkdir /app/storage +RUN mkdir -p /app/storage RUN rm -r /app/storage/* +COPY "Moonlight/defaultstorage" "/app/defaultstorage" ENTRYPOINT ["dotnet", "Moonlight.dll"] \ No newline at end of file