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.
 
 

48 lines
2.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 8001
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/Znyc.CloudCar.csproj", "Znyc.CloudCar/"]
COPY ["Znyc.CloudCar.Services/Znyc.CloudCar.Services.csproj", "Znyc.CloudCar.Services/"]
COPY ["Znyc.CloudCar.Auth/Znyc.CloudCar.Auth.csproj", "Znyc.CloudCar.Auth/"]
COPY ["Znyc.CloudCar.Configuration/Znyc.CloudCar.Configuration.csproj", "Znyc.CloudCar.Configuration/"]
COPY ["Znyc.CloudCar.Utility/Znyc.CloudCar.Utility.csproj", "Znyc.CloudCar.Utility/"]
COPY ["Znyc.CloudCar.Model/Znyc.CloudCar.Model.csproj", "Znyc.CloudCar.Model/"]
COPY ["Znyc.CloudCar.FreeSql/Znyc.CloudCar.FreeSql.csproj", "Znyc.CloudCar.FreeSql/"]
COPY ["Znyc.CloudCar.Core/Znyc.CloudCar.Core.csproj", "Znyc.CloudCar.Core/"]
COPY ["Znyc.CloudCar.RedisMQ/Znyc.CloudCar.RedisMQ.csproj", "Znyc.CloudCar.RedisMQ/"]
COPY ["Znyc.CloudCar.Loging/Znyc.CloudCar.Loging.csproj", "Znyc.CloudCar.Loging/"]
COPY ["Znyc.CloudCar.Caching/Znyc.CloudCar.Caching.csproj", "Znyc.CloudCar.Caching/"]
COPY ["Zncy.CloudCar.WeChat.Service/Zncy.CloudCar.WeChat.Service.csproj", "Zncy.CloudCar.WeChat.Service/"]
COPY ["Znyc.CloudCar.IServices/Znyc.CloudCar.IServices.csproj", "Znyc.CloudCar.IServices/"]
COPY ["Znyc.CloudCar.Swagger/Znyc.CloudCar.Swagger.csproj", "Znyc.CloudCar.Swagger/"]
COPY ["Znyc.CloudCar.Mapster/Znyc.CloudCar.Mapster.csproj", "Znyc.CloudCar.Mapster/"]
COPY ["Znyc.CloudCar.Hangfire/Znyc.CloudCar.Hangfire.csproj", "Znyc.CloudCar.Hangfire/"]
COPY ["Znyc.CloudCar.IRepository/Znyc.CloudCar.IRepository.csproj", "Znyc.CloudCar.IRepository/"]
COPY ["Znyc.CloudCar.Filter/Znyc.CloudCar.Filter.csproj", "Znyc.CloudCar.Filter/"]
COPY ["Znyc.CloudCar.Repository/Znyc.CloudCar.Repository.csproj", "Znyc.CloudCar.Repository/"]
COPY ["Znyc.CloudCar.Task/Znyc.CloudCar.Task.csproj", "Znyc.CloudCar.Task/"]
COPY ["Znyc.CloudCar.Middlewares/Znyc.CloudCar.Middlewares.csproj", "Znyc.CloudCar.Middlewares/"]
RUN dotnet restore "Znyc.CloudCar/Znyc.CloudCar.csproj"
COPY . .
WORKDIR "/src/Znyc.CloudCar"
RUN dotnet build "Znyc.CloudCar.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Znyc.CloudCar.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Znyc.CloudCar.dll"]