#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 ENV TZ=Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY ["Znyc.Recruitment.Api/Znyc.Recruitment.Api.csproj", "Znyc.Recruitment.Api/"] COPY ["Znyc.Recruitment.Services/Znyc.Recruitment.Service.csproj", "Znyc.Recruitment.Services/"] COPY ["Znyc.Recruitment.Repository/Znyc.Recruitment.Repository.csproj", "Znyc.Recruitment.Repository/"] COPY ["Znyc.Recruitment.Model/Znyc.Recruitment.Model.csproj", "Znyc.Recruitment.Model/"] COPY ["Znyc.Recruitment.Common/Znyc.Recruitment.Common.csproj", "Znyc.Recruitment.Common/"] RUN dotnet restore "Znyc.Recruitment.Api/Znyc.Recruitment.Api.csproj" COPY . . WORKDIR "/src/Znyc.Recruitment.Api" RUN dotnet build "Znyc.Recruitment.Api.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "Znyc.Recruitment.Api.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "Znyc.Recruitment.Api.dll"]