-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathDockerfile.mscoreone.dev
27 lines (23 loc) · 1.12 KB
/
Dockerfile.mscoreone.dev
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
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
# copy csproj and restore as distinct layers
COPY src/MsCoreOne.Application/*.csproj ./src/MsCoreOne.Application/
COPY src/MsCoreOne.Api/*.csproj ./src/MsCoreOne.Api/
COPY src/MsCoreOne.Domain/*.csproj ./src/MsCoreOne.Domain/
COPY src/MsCoreOne.Infrastructure/*.csproj ./src/MsCoreOne.Infrastructure/
COPY src/MsCoreOne.FrontMvc/*.csproj ./src/MsCoreOne.FrontMvc/
COPY tests/MsCoreOne.IntegrationTests/*.csproj ./tests/MsCoreOne.IntegrationTests/
COPY MsCoreOne.sln ./
RUN dotnet restore -nowarn:msb3202,nu1503
# copy everything else and build app
COPY src/MsCoreOne.Application/. ./src/MsCoreOne.Application/
COPY src/MsCoreOne.Api/. ./src/MsCoreOne.Api/
COPY src/MsCoreOne.Domain/. ./src/MsCoreOne.Domain/
COPY src/MsCoreOne.Infrastructure/. ./src/MsCoreOne.Infrastructure/
COPY tests/MsCoreOne.IntegrationTests/. ./tests/MsCoreOne.IntegrationTests/
WORKDIR /src/src/MsCoreOne.Api
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS runtime
WORKDIR /app
COPY --from=build /src/src/MsCoreOne.Api/out ./
ENTRYPOINT ["dotnet", "MsCoreOne.Api.dll"]