|
1 | 1 | FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base |
| 2 | + |
| 3 | +ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true |
| 4 | + |
2 | 5 | WORKDIR /app |
| 6 | + |
3 | 7 | EXPOSE 8080 |
4 | 8 |
|
5 | | -ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true |
| 9 | +####################################################################################################### |
| 10 | +# BUILD ANGULAR |
| 11 | +####################################################################################################### |
6 | 12 |
|
7 | 13 | FROM node:18.15.0-alpine AS angularBuild |
| 14 | + |
8 | 15 | WORKDIR /angular |
| 16 | + |
9 | 17 | COPY ["authorization/EventTriangle.Client/package.json", "EventTriangle.Client/"] |
10 | 18 | COPY ["authorization/EventTriangle.Client/package-lock.json", "EventTriangle.Client/"] |
| 19 | + |
11 | 20 | WORKDIR "EventTriangle.Client" |
| 21 | + |
12 | 22 | RUN npm ci |
| 23 | + |
13 | 24 | WORKDIR /angular |
| 25 | + |
14 | 26 | COPY ["authorization/EventTriangle.Client", "EventTriangle.Client/"] |
| 27 | + |
15 | 28 | RUN npm install -g @angular/cli@15.2.7 |
| 29 | + |
16 | 30 | WORKDIR "EventTriangle.Client" |
| 31 | + |
17 | 32 | ARG FRONT_API_URL |
| 33 | + |
18 | 34 | RUN sed -i "s|https://localhost:7000/|$FRONT_API_URL|" ./src/assets/config/config.json |
| 35 | + |
19 | 36 | RUN ng build --output-path "dist/client" |
20 | 37 |
|
| 38 | +####################################################################################################### |
| 39 | +# BUILD DOTNET |
| 40 | +####################################################################################################### |
| 41 | + |
21 | 42 | FROM mcr.microsoft.com/dotnet/sdk:10.0 AS publish |
| 43 | + |
22 | 44 | WORKDIR /src |
| 45 | + |
23 | 46 | COPY ["authorization/EventTriangleAPI.Authorization.BusinessLogic/EventTriangleAPI.Authorization.BusinessLogic.csproj", "authorization/EventTriangleAPI.Authorization.BusinessLogic/"] |
24 | 47 | COPY ["authorization/EventTriangleAPI.Authorization.Domain/EventTriangleAPI.Authorization.Domain.csproj", "authorization/EventTriangleAPI.Authorization.Domain/"] |
25 | 48 | COPY ["authorization/EventTriangleAPI.Authorization.Persistence/EventTriangleAPI.Authorization.Persistence.csproj", "authorization/EventTriangleAPI.Authorization.Persistence/"] |
26 | 49 | COPY ["authorization/EventTriangleAPI.Authorization.Presentation/EventTriangleAPI.Authorization.Presentation.csproj", "authorization/EventTriangleAPI.Authorization.Presentation/"] |
27 | | -COPY ["authorization/EventTriangleAPI.Authorization.UnitTests/EventTriangleAPI.Authorization.UnitTests.csproj", "authorization/EventTriangleAPI.Authorization.UnitTests/"] |
28 | 50 | COPY ["shared/EventTriangleAPI.Shared.Application/EventTriangleAPI.Shared.Application.csproj", "shared/EventTriangleAPI.Shared.Application/"] |
29 | 51 | COPY ["shared/EventTriangleAPI.Shared.DTO/EventTriangleAPI.Shared.DTO.csproj", "shared/EventTriangleAPI.Shared.DTO/"] |
| 52 | + |
30 | 53 | RUN dotnet restore "authorization/EventTriangleAPI.Authorization.Presentation/EventTriangleAPI.Authorization.Presentation.csproj" |
| 54 | + |
31 | 55 | COPY . . |
| 56 | + |
32 | 57 | WORKDIR "authorization/EventTriangleAPI.Authorization.Presentation" |
| 58 | + |
33 | 59 | ARG VERSION |
| 60 | + |
34 | 61 | RUN dotnet publish "EventTriangleAPI.Authorization.Presentation.csproj" -c Release -p:Version=$VERSION -o /app/publish /p:UseAppHost=false |
35 | 62 |
|
| 63 | +####################################################################################################### |
| 64 | +# CREATE FINAL ARTIFACT |
| 65 | +####################################################################################################### |
| 66 | + |
36 | 67 | FROM base AS final |
37 | 68 | WORKDIR /app |
38 | 69 | COPY --from=publish /app/publish . |
|
0 commit comments