#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. FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build WORKDIR /src COPY ["TelpoPush.Position.Worker/TelpoPush.Position.Worker.csproj", "TelpoPush.Position.Worker/"] COPY ["nuget.config","."] RUN dotnet nuget remove source nuget.org RUN dotnet nuget add source https://repo.huaweicloud.com/repository/nuget/v3/index.json -n huaweicloud_nuget RUN dotnet restore "TelpoPush.Position.Worker/TelpoPush.Position.Worker.csproj" COPY . . WORKDIR "/src/TelpoPush.Position.Worker" FROM build AS publish RUN dotnet publish "TelpoPush.Position.Worker.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . #COPY pem /app/pem ENV environment=Development RUN apk add --no-cache tzdata ENV TimeZone=Asia/Shanghai ENV LANG C.UTF-8 ENV ASPNETCORE_ENVIRONMENT_LOG=Development RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone ENTRYPOINT dotnet TelpoPush.Position.Worker.dll --environment=$environment