Skip to content

Commit 109ba74

Browse files
authored
Merge pull request #14 from sven-pohl/fix/docker_fix
Fix/docker fix
2 parents cdad002 + f1a6334 commit 109ba74

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
1-
# Use the official .NET 8 SDK image as a build stage
2-
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
3-
4-
# Set the working directory
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
52
WORKDIR /app
63

7-
# Copy the project file and restore dependencies
4+
# Copy csproj and restore as distinct layers
85
COPY *.csproj ./
96
RUN dotnet restore
107

11-
# Copy the rest of the application code
8+
# Copy everything else and build
129
COPY . ./
13-
14-
# Build the application
1510
RUN dotnet publish -c Release -o out
1611

17-
# Use the official .NET 8 runtime image as a runtime stage
12+
# Build runtime image
1813
FROM mcr.microsoft.com/dotnet/aspnet:8.0
19-
20-
# Set the working directory
2114
WORKDIR /app
22-
23-
# Copy the built application from the build stage
24-
COPY --from=build /app/out .
25-
26-
# Set the entry point for the application
15+
COPY --from=build-env /app/out .
16+
# Default ASP.NET port changed with .NET 8.0
17+
ENV ASPNETCORE_HTTP_PORTS=80
2718
ENTRYPOINT ["dotnet", "RazorPagesTestSample.dll"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"profiles": {
3+
"RazorPagesTestSample": {
4+
"commandName": "Project",
5+
"launchBrowser": true,
6+
"environmentVariables": {
7+
"ASPNETCORE_ENVIRONMENT": "Development"
8+
},
9+
"applicationUrl": "https://localhost:59101;http://localhost:59102"
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)