diff --git a/.gitignore b/.gitignore index 2b4a264..3528fe1 100755 --- a/.gitignore +++ b/.gitignore @@ -4,13 +4,9 @@ obj/ riderModule.iml /_ReSharper.Caches/ /.vs -<<<<<<< Updated upstream -/OmegaLeo.HelperLib.Web -======= /OmegaLeo.HelperLib.Web/.config /OmegaLeo.HelperLib.Web/Properties/PublishProfiles /OmegaLeo.HelperLib.Web/publish ->>>>>>> Stashed changes /OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj.user *.sh \ No newline at end of file diff --git a/OmegaLeo.HelperLib.Web/Dockerfile b/OmegaLeo.HelperLib.Web/Dockerfile new file mode 100644 index 0000000..2deb9c6 --- /dev/null +++ b/OmegaLeo.HelperLib.Web/Dockerfile @@ -0,0 +1,15 @@ +# Build context is the repository root (the Web project references sibling library projects). +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +WORKDIR /src +COPY . . +RUN dotnet publish "OmegaLeo.HelperLib.Web/OmegaLeo.HelperLib.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final +WORKDIR /app +COPY --from=build /app/publish . +# Serilog writes to /app/logs; make it writable for the non-root "app" user. +RUN mkdir -p /app/logs && chown -R app:app /app/logs +USER app +ENV ASPNETCORE_HTTP_PORTS=8080 +EXPOSE 8080 +ENTRYPOINT ["dotnet", "OmegaLeo.HelperLib.Web.dll"]