diff --git a/Tsi1.Api/Dockerfile b/Tsi1.Api/Dockerfile index add26c0df433dc0d6248384d330cacfc0574e539..167276779302018c1363b79342d8aa59d39cbf67 100644 --- a/Tsi1.Api/Dockerfile +++ b/Tsi1.Api/Dockerfile @@ -18,6 +18,7 @@ RUN dotnet publish -c release -o /app/publish # final stage/image FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 WORKDIR /app +RUN mkdir /app/StaticFiles COPY --from=build /app/publish . EXPOSE 5000 ENTRYPOINT ["dotnet", "Tsi1.Api.dll"] \ No newline at end of file diff --git a/Tsi1.Api/Tsi1.Api/Startup.cs b/Tsi1.Api/Tsi1.Api/Startup.cs index 135212e330271889277770863aa98754ea3dcd31..991fdf3c7801ede272682689829eacea0793d2ed 100644 --- a/Tsi1.Api/Tsi1.Api/Startup.cs +++ b/Tsi1.Api/Tsi1.Api/Startup.cs @@ -188,14 +188,14 @@ namespace Tsi1.Api app.UseAuthorization(); var provider = new FileExtensionContentTypeProvider(); + app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = provider, FileProvider = new PhysicalFileProvider( Path.Combine(env.ContentRootPath, "StaticFiles")), RequestPath = "/static" - } - ); + }); app.UseEndpoints(endpoints => {