-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathDockerfilepublish
30 lines (26 loc) · 1.2 KB
/
Dockerfilepublish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#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
ENV TZ=Asia/Shanghai
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
RUN ls
COPY ["src/Sukt.Admin.Api/Sukt.Admin.Api.csproj", "src/Sukt.Admin.Api/"]
COPY ["src/Sukt.Admin.Application/Sukt.Admin.Application.csproj", "src/Sukt.Admin.Application/"]
COPY ["src/Sukt.Admin.Domain/Sukt.Admin.Domain.csproj", "src/Sukt.Admin.Domain/"]
COPY ["src/Sukt.Admin.Dto/Sukt.Admin.Dto.csproj", "src/Sukt.Admin.Dto/"]
COPY ["src/Sukt.Admin.Query/Sukt.Admin.Query.csproj", "src/Sukt.Admin.Query/"]
COPY ["src/Sukt.Admin.EntityFrameworkCore/Sukt.Admin.EntityFrameworkCore.csproj", "src/Sukt.Admin.EntityFrameworkCore/"]
RUN dotnet restore "src/Sukt.Admin.Api/Sukt.Admin.Api.csproj"
RUN ls
COPY . .
WORKDIR "/src/src/Sukt.Admin.Api"
RUN dotnet build "Sukt.Admin.Api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Sukt.Admin.Api.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
ENV TZ=Asia/Shanghai
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Sukt.Admin.Api.dll"]