Skip to content

Commit cb4261d

Browse files
committed
update dotnet image version and port
1 parent d5410f0 commit cb4261d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Dockerfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
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
36

47
# Set the working directory
58
WORKDIR /app
@@ -13,14 +16,17 @@ RUN dotnet restore
1316
# Publish the application
1417
RUN dotnet publish -c Release -o out
1518

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
1821

1922
# Set the working directory
2023
WORKDIR /app
2124

2225
# Copy the published application from the build image
2326
COPY --from=build /app/out .
2427

28+
# Expose port 8080 (matching the log)
29+
EXPOSE 8080
30+
2531
# Set the entrypoint
26-
ENTRYPOINT ["dotnet", "dotnet-csharp-redis-demo.dll"]
32+
ENTRYPOINT ["dotnet", "dotnet-csharp-redis-demo.dll"]

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
context: .
77
dockerfile: Dockerfile
88
ports:
9-
- "5001:80"
9+
- "5001:8080" # Map external port 5001 to internal port 8080
1010
environment:
1111
- REDIS_HOST=${REDIS_HOST}
1212
- REDIS_PORT=${REDIS_PORT}

0 commit comments

Comments
 (0)