Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

36 lignes
1.5KB

  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. FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
  3. WORKDIR /app
  4. EXPOSE 80
  5. FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
  6. ARG BUILD_CONFIGURATION=Release
  7. WORKDIR /src
  8. COPY ["TelpoKafkaConsole.WebApi/TelpoKafkaConsole.WebApi.csproj", "TelpoKafkaConsole.WebApi/"]
  9. COPY ["TelpoKafkaConsole.Common/TelpoKafkaConsole.Common.csproj", "TelpoKafkaConsole.Common/"]
  10. COPY ["TelpoKafkaConsole.Service/TelpoKafkaConsole.Service.csproj", "TelpoKafkaConsole.Service/"]
  11. COPY ["TelpoKafkaConsole.Model/TelpoKafkaConsole.Model.csproj", "TelpoKafkaConsole.Model/"]
  12. RUN dotnet restore "./TelpoKafkaConsole.WebApi/./TelpoKafkaConsole.WebApi.csproj"
  13. COPY . .
  14. WORKDIR "/src/TelpoKafkaConsole.WebApi"
  15. RUN dotnet build "./TelpoKafkaConsole.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/build
  16. FROM build AS publish
  17. ARG BUILD_CONFIGURATION=Release
  18. RUN dotnet publish "./TelpoKafkaConsole.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
  19. FROM base AS final
  20. WORKDIR /app
  21. COPY --from=publish /app/publish .
  22. COPY pem /app/pem
  23. ENV environment=Development
  24. ENV TimeZone=Asia/Shanghai
  25. ENV LANG C.UTF-8
  26. RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone
  27. #ENTRYPOINT ["dotnet", "TelpoKafkaConsole.WebApi.dll"]
  28. ENTRYPOINT ["sh", "-c", "dotnet TelpoKafkaConsole.WebApi.dll --environment=$environment"]