-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
38 lines (33 loc) · 1.45 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
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM node:16.19-alpine AS angularBuild
WORKDIR /angular
COPY ["MangoAPI.Client/package.json", "MangoAPI.Client/"]
COPY ["MangoAPI.Client/package-lock.json", "MangoAPI.Client/"]
WORKDIR "/angular/MangoAPI.Client"
RUN npm ci
WORKDIR /angular
COPY ["MangoAPI.Client", "MangoAPI.Client/"]
RUN npm install -g @angular/cli@13.3.4
WORKDIR "/angular/MangoAPI.Client"
RUN ng build --aot --configuration docker
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["MangoAPI.Presentation/MangoAPI.Presentation.csproj", "MangoAPI.Presentation/"]
COPY ["MangoAPI.BusinessLogic/MangoAPI.BusinessLogic.csproj", "MangoAPI.BusinessLogic/"]
COPY ["MangoAPI.Application/MangoAPI.Application.csproj", "MangoAPI.Application/"]
COPY ["MangoAPI.Domain/MangoAPI.Domain.csproj", "MangoAPI.Domain/"]
COPY ["MangoAPI.Infrastructure/MangoAPI.Infrastructure.csproj", "MangoAPI.Infrastructure/"]
RUN dotnet restore "MangoAPI.Presentation/MangoAPI.Presentation.csproj"
COPY . .
WORKDIR "/src/MangoAPI.Presentation"
RUN dotnet build "MangoAPI.Presentation.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "MangoAPI.Presentation.csproj" -c Release -o /app/publish /p:UseAppHost=false
COPY --from=angularBuild /angular/MangoAPI.Presentation/wwwroot/ /app/publish/wwwroot/
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MangoAPI.Presentation.dll"]