even more changes to the Dockerfile
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -1,24 +1,25 @@
|
||||
# Base image for runtime
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
USER app
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
# Build stage for ASP.NET Core
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["YatzyGame/YatzyGame.csproj", "./YatzyGame/"]
|
||||
RUN dotnet restore "./YatzyGame/YatzyGame.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src"
|
||||
RUN dotnet build "./YatzyGame/YatzyGame.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
COPY ["YatzyGame/YatzyGame.csproj", "YatzyGame/"]
|
||||
COPY ["YatzyLibrary/YatzyLibrary.csproj", "YatzyLibrary/"]
|
||||
RUN dotnet restore "YatzyGame/YatzyGame.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/YatzyGame"
|
||||
RUN dotnet build "YatzyGame.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
# Publish ASP.NET Core app
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./YatzyGame/YatzyGame.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
RUN dotnet publish "YatzyGame.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
# Final runtime stage
|
||||
FROM base AS final
|
||||
|
||||
Reference in New Issue
Block a user