File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1
- # Use the lighter version of the .NET SDK as the base image
2
- FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
1
+ # Use the .NET 9.0 SDK as the base image
2
+ FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
3
+
4
+ # Set environment to Development
5
+ ENV ASPNETCORE_ENVIRONMENT=Development
3
6
4
7
# Set the working directory
5
8
WORKDIR /app
@@ -13,14 +16,17 @@ RUN dotnet restore
13
16
# Publish the application
14
17
RUN dotnet publish -c Release -o out
15
18
16
- # Use the lighter version of the ASP.NET Runtime as the final base image
17
- FROM mcr.microsoft.com/dotnet/aspnet:7 .0-alpine
19
+ # Use the .NET 9.0 ASP.NET Runtime as the final base image
20
+ FROM mcr.microsoft.com/dotnet/aspnet:9 .0-alpine
18
21
19
22
# Set the working directory
20
23
WORKDIR /app
21
24
22
25
# Copy the published application from the build image
23
26
COPY --from=build /app/out .
24
27
28
+ # Expose port 8080 (matching the log)
29
+ EXPOSE 8080
30
+
25
31
# Set the entrypoint
26
- ENTRYPOINT ["dotnet" , "dotnet-csharp-redis-demo.dll" ]
32
+ ENTRYPOINT ["dotnet" , "dotnet-csharp-redis-demo.dll" ]
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ services:
6
6
context : .
7
7
dockerfile : Dockerfile
8
8
ports :
9
- - " 5001:80 "
9
+ - " 5001:8080 " # Map external port 5001 to internal port 8080
10
10
environment :
11
11
- REDIS_HOST=${REDIS_HOST}
12
12
- REDIS_PORT=${REDIS_PORT}
You can’t perform that action at this time.
0 commit comments