even more changes to the Dockerfile
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,24 +1,25 @@
|
|||||||
# Base image for runtime
|
# 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
|
USER app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
EXPOSE 8081
|
EXPOSE 8081
|
||||||
|
|
||||||
# Build stage for ASP.NET Core
|
# 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
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["YatzyGame/YatzyGame.csproj", "./YatzyGame/"]
|
COPY ["YatzyGame/YatzyGame.csproj", "YatzyGame/"]
|
||||||
RUN dotnet restore "./YatzyGame/YatzyGame.csproj"
|
COPY ["YatzyLibrary/YatzyLibrary.csproj", "YatzyLibrary/"]
|
||||||
|
RUN dotnet restore "YatzyGame/YatzyGame.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src"
|
WORKDIR "/src/YatzyGame"
|
||||||
RUN dotnet build "./YatzyGame/YatzyGame.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
RUN dotnet build "YatzyGame.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||||
|
|
||||||
# Publish ASP.NET Core app
|
# Publish ASP.NET Core app
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
ARG BUILD_CONFIGURATION=Release
|
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
|
# Final runtime stage
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
|
|||||||
Reference in New Issue
Block a user