diff --git a/src/Application/src/RazorPagesTestSample/Dockerfile b/src/Application/src/RazorPagesTestSample/Dockerfile index 52e10376..ab3fcaf2 100644 --- a/src/Application/src/RazorPagesTestSample/Dockerfile +++ b/src/Application/src/RazorPagesTestSample/Dockerfile @@ -1,27 +1,18 @@ -# Use the official .NET 8 SDK image as a build stage -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build - -# Set the working directory +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env WORKDIR /app -# Copy the project file and restore dependencies +# Copy csproj and restore as distinct layers COPY *.csproj ./ RUN dotnet restore -# Copy the rest of the application code +# Copy everything else and build COPY . ./ - -# Build the application RUN dotnet publish -c Release -o out -# Use the official .NET 8 runtime image as a runtime stage +# Build runtime image FROM mcr.microsoft.com/dotnet/aspnet:8.0 - -# Set the working directory WORKDIR /app - -# Copy the built application from the build stage -COPY --from=build /app/out . - -# Set the entry point for the application +COPY --from=build-env /app/out . +# Default ASP.NET port changed with .NET 8.0 +ENV ASPNETCORE_HTTP_PORTS=80 ENTRYPOINT ["dotnet", "RazorPagesTestSample.dll"] \ No newline at end of file diff --git a/src/Application/src/RazorPagesTestSample/Properties/launchSettings.json b/src/Application/src/RazorPagesTestSample/Properties/launchSettings.json new file mode 100644 index 00000000..88429b9d --- /dev/null +++ b/src/Application/src/RazorPagesTestSample/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "RazorPagesTestSample": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:59101;http://localhost:59102" + } + } +} \ No newline at end of file