22 lines
636 B
Docker
22 lines
636 B
Docker
FROM mcr.microsoft.com/dotnet/dotnet:9.0 AS base
|
|
USER $APP_UID
|
|
WORKDIR /app
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|
ARG BUILD_CONFIGURATION=Release
|
|
WORKDIR /src
|
|
COPY ["TelegramBot/TelegramBot.csproj", "TelegramBot/"]
|
|
RUN dotnet restore "TelegramBot/TelegramBot.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/TelegramBot"
|
|
RUN dotnet build "TelegramBot.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
|
|
|
FROM build AS publish
|
|
ARG BUILD_CONFIGURATION=Release
|
|
RUN dotnet publish "TelegramBot.csproj" -c $BUILD_CONFIGURATION -o /app/publish
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "TelegramBot.dll"]
|