at main 1.2 kB view raw
1# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. 2 3# This stage is used when running from VS in fast mode (Default for Debug configuration) 4FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base 5USER $APP_UID 6WORKDIR /app 7 8 9# This stage is used to build the service project 10FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build 11ARG BUILD_CONFIGURATION=Release 12WORKDIR /src 13COPY ["Directory.Packages.props", "."] 14COPY ["AltBot.Worker/AltBot.Worker.csproj", "AltBot.Worker/"] 15RUN dotnet restore "./AltBot.Worker/AltBot.Worker.csproj" 16COPY . . 17WORKDIR "/src/AltBot.Worker" 18RUN dotnet build "./AltBot.Worker.csproj" -c $BUILD_CONFIGURATION -o /app/build 19 20# This stage is used to publish the service project to be copied to the final stage 21FROM build AS publish 22ARG BUILD_CONFIGURATION=Release 23RUN dotnet publish "./AltBot.Worker.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false 24 25# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) 26FROM base AS final 27WORKDIR /app 28COPY --from=publish /app/publish . 29ENTRYPOINT ["dotnet", "AltBot.Worker.dll"]