-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
77 lines (50 loc) · 2.11 KB
/
dockerfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 80:80
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY CoreApplication.sln ./
COPY CoreApplication.Common/*.csproj ./CoreApplication.Common/
COPY CoreApplication.Business.Test/*.csproj ./CoreApplication.Business.Test/
COPY CoreApplication.Data/*.csproj ./CoreApplication.Data/
COPY CoreApplication.Data.Contracts/*.csproj ./CoreApplication.Data.Contracts/
COPY CoreApplication.Data.Entity/*.csproj ./CoreApplication.Data.Entity/
COPY CoreApplication.Business.DTO/*.csproj ./CoreApplication.Business.DTO/
COPY CoreApplication.Business/*.csproj ./CoreApplication.Business/
COPY CoreApplication.Business.Contracts/*.csproj ./CoreApplication.Business.Contracts/
COPY CoreApplication.API/*.csproj ./CoreApplication.API/
COPY CoreApplication.DTO/*.csproj ./CoreApplication.DTO/
COPY CoreApplication.Middlewares/*.csproj ./CoreApplication.Middlewares/
COPY CoreApplication.Bootstrapper/*.csproj ./CoreApplication.Bootstrapper/
RUN dotnet restore
COPY . .
WORKDIR /src/CoreApplication.Common
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Business.Test
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Data.Entity
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Data.Contracts
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Data
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Business.DTO
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Business.Contracts
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Business
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Middlewares
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.DTO
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.Bootstrapper
RUN dotnet build -c Release -o /app
WORKDIR /src/CoreApplication.API
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "CoreApplication.API.dll"]