diff --git a/Dockerfile b/Dockerfile index 3fffd79..5c323ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ # Use the official ASP.NET Core runtime as a parent image FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app -EXPOSE 5000 +EXPOSE 5000 5001 +ENV ASPNETCORE_URLS=https://*:5001;http://*:5000 # Use the SDK image to build the app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build @@ -19,4 +20,5 @@ RUN dotnet publish "douwco.be.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . +COPY ["./certificate.pfx", "/app/certificate.pfx"] ENTRYPOINT ["dotnet", "douwco.be.dll"] diff --git a/Program.cs b/Program.cs index 7bb285d..5a7d840 100644 --- a/Program.cs +++ b/Program.cs @@ -1,5 +1,14 @@ var builder = WebApplication.CreateBuilder(args); + builder.WebHost.UseUrls("http://*:5000"); +builder.WebHost.ConfigureKestrel(options => +{ + options.ListenAnyIP(5001, listenOptions => + { + listenOptions.UseHttps("/app/certificate.pfx", "douwco_website"); + }); +}); + var app = builder.Build(); app.UseStaticFiles(); diff --git a/wwwroot/README.md b/README.md similarity index 100% rename from wwwroot/README.md rename to README.md diff --git a/certificate.pfx b/certificate.pfx new file mode 100644 index 0000000..39b8581 Binary files /dev/null and b/certificate.pfx differ diff --git a/obj/Debug/net8.0/douwco.be.AssemblyInfo.cs b/obj/Debug/net8.0/douwco.be.AssemblyInfo.cs index 659c977..2ba6a0e 100644 --- a/obj/Debug/net8.0/douwco.be.AssemblyInfo.cs +++ b/obj/Debug/net8.0/douwco.be.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("douwco.be")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+40bc778f29b5fd32a057f7dc38a67df115078301")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ef528aa10f4b3023fcb0b390f9bc3fbb9e556310")] [assembly: System.Reflection.AssemblyProductAttribute("douwco.be")] [assembly: System.Reflection.AssemblyTitleAttribute("douwco.be")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net8.0/douwco.be.AssemblyInfoInputs.cache b/obj/Debug/net8.0/douwco.be.AssemblyInfoInputs.cache index 8282857..972f6d1 100644 --- a/obj/Debug/net8.0/douwco.be.AssemblyInfoInputs.cache +++ b/obj/Debug/net8.0/douwco.be.AssemblyInfoInputs.cache @@ -1 +1 @@ -b66fe98ff0bcbc21f45df330d12f67895e13da8431f3c9c8386e535dcf228e2b +af406788523d4d8abd228b688c7e0a51b47a570d106336ab61c277d07f20bb78