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.
30 lines
1.5 KiB
30 lines
1.5 KiB
#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 8091
|
|
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.Cloudcar.Admin.WebApi/Znyc.Cloudcar.Admin.WebApi.csproj", "Znyc.Cloudcar.Admin.WebApi/"]
|
|
COPY ["Znyc.Cloudcar.Admin.Security.Core/Znyc.Cloudcar.Admin.Security.Core.csproj", "Znyc.Cloudcar.Admin.Security.Core/"]
|
|
COPY ["Znyc.Cloudcar.Admin.Commons/Znyc.Cloudcar.Admin.Commons.csproj", "Znyc.Cloudcar.Admin.Commons/"]
|
|
COPY ["Znyc.Cloudcar.Admin.WeChat.Core/Znyc.Cloudcar.Admin.WeChat.Core.csproj", "Znyc.Cloudcar.Admin.WeChat.Core/"]
|
|
COPY ["Znyc.Cloudcar.Admin.MongoDb/Znyc.Cloudcar.Admin.MongoDb.Core.csproj", "Znyc.Cloudcar.Admin.MongoDb/"]
|
|
COPY ["Znyc.Cloudcar.Admin.AspNetCore/Znyc.Cloudcar.Admin.AspNetCore.csproj", "Znyc.Cloudcar.Admin.AspNetCore/"]
|
|
RUN dotnet restore "Znyc.Cloudcar.Admin.WebApi/Znyc.Cloudcar.Admin.WebApi.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/Znyc.Cloudcar.Admin.WebApi"
|
|
RUN dotnet build "Znyc.Cloudcar.Admin.WebApi.csproj" -c Release -o /app/build
|
|
|
|
FROM build AS publish
|
|
RUN dotnet publish "Znyc.Cloudcar.Admin.WebApi.csproj" -c Release -o /app/publish
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "Znyc.Cloudcar.Admin.WebApi.dll"]
|