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