|
- #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.Fence.Worker/TelpoPush.Fence.Worker.csproj", "TelpoPush.Fence.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.Fence.Worker/TelpoPush.Fence.Worker.csproj"
- COPY . .
- WORKDIR "/src/TelpoPush.Fence.Worker"
-
- FROM build AS publish
- RUN dotnet publish "TelpoPush.Fence.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.Fence.Worker.dll --environment=$environment
|