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