电子围栏推送服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 1.2KB

5 ay önce
123456789101112131415161718192021222324252627282930
  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/sdk:8.0-alpine AS base
  3. WORKDIR /app
  4. FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
  5. WORKDIR /src
  6. COPY ["TelpoPush.Fence.Worker/TelpoPush.Fence.Worker.csproj", "TelpoPush.Fence.Worker/"]
  7. COPY ["nuget.config","."]
  8. RUN dotnet nuget remove source nuget.org
  9. RUN dotnet nuget add source https://repo.huaweicloud.com/repository/nuget/v3/index.json -n huaweicloud_nuget
  10. RUN dotnet restore "TelpoPush.Fence.Worker/TelpoPush.Fence.Worker.csproj"
  11. COPY . .
  12. WORKDIR "/src/TelpoPush.Fence.Worker"
  13. FROM build AS publish
  14. RUN dotnet publish "TelpoPush.Fence.Worker.csproj" -c Release -o /app/publish
  15. FROM base AS final
  16. WORKDIR /app
  17. COPY --from=publish /app/publish .
  18. #COPY pem /app/pem
  19. ENV environment=Development
  20. RUN apk add --no-cache tzdata
  21. ENV TimeZone=Asia/Shanghai
  22. ENV LANG C.UTF-8
  23. ENV ASPNETCORE_ENVIRONMENT_LOG=Development
  24. RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone
  25. ENTRYPOINT dotnet TelpoPush.Fence.Worker.dll --environment=$environment