FritzTheCat9/YoutubeLinks

fix: Docker Email Templates path error

Closed this issue · 1 comments

  • error on docker when trying to register
  • copy templates to docker container
  • fix paths to files

Could not find a part of the path '/app\Emails\Templates/EmailConfirmationTemplate.cshtml'.\n
image

  • we should use Path.Combine when working with paths not / or \ (The path separator that Linux uses is Slash. The path separator that Windows uses is backward slash.)
  • also we should copy email templates to .csproj (CopyToOutputDirectory)
  • then copy files in Dockerfile
    // Copy email templates
    COPY ["YoutubeLinks.Api/Emails/Templates/", "/src/Emails/Templates/"]
    // Copy email templates
    COPY --from=build /src/Emails/Templates /app/Emails/Templates