TgBots/Dockerfile
Dmitrii Prokudin 42d85b6f03
All checks were successful
Local Deploy with Docker / build-and-deploy (push) Successful in 4s
Dockerfile
2024-12-25 05:12:59 +03:00

25 lines
772 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Базовый образ с ASP.NET Core Runtime
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
# Базовый образ для сборки
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["UserOfTheDayBot.csproj", "./"]
RUN dotnet restore "UserOfTheDayBot.csproj"
COPY . .
WORKDIR "/src/"
RUN dotnet build "UserOfTheDayBot.csproj" -c $BUILD_CONFIGURATION -o /app/build
# Публикация
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "UserOfTheDayBot.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# Финальный образ
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "UserOfTheDayBot.dll"]