mirror of
https://github.com/Kizuren/QuizConnect.git
synced 2025-12-21 21:16:14 +01:00
22 lines
623 B
Docker
22 lines
623 B
Docker
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
|
USER $APP_UID
|
|
WORKDIR /app
|
|
EXPOSE 8080
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|
ARG BUILD_CONFIGURATION=Release
|
|
WORKDIR /src
|
|
COPY ["Server/Server.csproj", "Server/"]
|
|
RUN dotnet restore "Server/Server.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/Server"
|
|
RUN dotnet build "Server.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
|
|
|
FROM build AS publish
|
|
ARG BUILD_CONFIGURATION=Release
|
|
RUN dotnet publish "Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "Server.dll"]
|