Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion argocd/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
project: default
source:
repoURL: https://github.com/Cognition-Partner-Workshops/app_dotnet-angular-monolith-iac.git
repoURL: https://github.com/Cognition-Partner-Workshops/ordermanager-iac.git
targetRevision: main
path: helm/ordermanager
helm:
Expand Down
2 changes: 1 addition & 1 deletion argocd/application-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
project: default
source:
repoURL: https://github.com/Cognition-Partner-Workshops/app_dotnet-angular-monolith-iac.git
repoURL: https://github.com/Cognition-Partner-Workshops/ordermanager-iac.git
targetRevision: main
path: helm/ordermanager
helm:
Expand Down
10 changes: 5 additions & 5 deletions ci/build-push.yaml
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Checkout app code
uses: actions/checkout@v4
with:
repository: Cognition-Partner-Workshops/app_dotnet-angular-monolith
repository: Cognition-Partner-Workshops/ordermanager-monolith
path: app

- name: Checkout IaC
Expand All @@ -41,13 +41,13 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Run .NET tests
working-directory: app
run: dotnet test --verbosity normal

- name: Build and push Docker image
working-directory: app
run: |
docker build -f ../iac/docker/Dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest

- name: Run .NET tests
working-directory: app
run: dotnet test --verbosity normal
13 changes: 7 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Stage 1: Build Angular client
FROM node:20-alpine AS client-build
WORKDIR /app/client
COPY client-app/package*.json ./
RUN npm ci
COPY client-app/ ./
RUN npm run build
WORKDIR /app
COPY client-app/package*.json client-app/
RUN cd client-app && npm ci
COPY client-app/ client-app/
# angular.json outputs to ../src/OrderManager.Api/wwwroot (browser/ subfolder)
RUN cd client-app && npm run build

# Stage 2: Build .NET API
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS api-build
Expand All @@ -14,7 +15,7 @@ COPY src/OrderManager.Api/OrderManager.Api.csproj src/OrderManager.Api/
COPY tests/OrderManager.Api.Tests/OrderManager.Api.Tests.csproj tests/OrderManager.Api.Tests/
RUN dotnet restore
COPY . .
COPY --from=client-build /app/client/dist/client-app/browser src/OrderManager.Api/wwwroot/
COPY --from=client-build /app/src/OrderManager.Api/wwwroot/browser src/OrderManager.Api/wwwroot/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Dockerfile Angular output path depends on angular.json configuration in a separate repository

The COPY source path changed from /app/client/dist/client-app/browser (standard Angular CLI default output) to /app/src/OrderManager.Api/wwwroot/browser (docker/Dockerfile:18). This new path assumes the Angular project's angular.json has a custom outputPath set to ../src/OrderManager.Api/wwwroot. If the ordermanager-monolith app repo's angular.json doesn't have this exact configuration, the Docker build will fail at this COPY step. The comment on line 7 documents this assumption, but it cannot be verified from this repo alone.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed against the app repo: ordermanager-monolith/client-app/angular.json sets outputPath: ../src/OrderManager.Api/wwwroot and the Angular 17 application builder emits into a browser/ subfolder, so the assets land at /app/src/OrderManager.Api/wwwroot/browser. I verified end-to-end with a real docker build — it succeeds and the container serves /, /health, and /api/products (all 200). The prior dist/client-app/browser path did not exist and the build failed at that COPY.

RUN dotnet publish src/OrderManager.Api/OrderManager.Api.csproj -c Release -o /app/publish

# Stage 3: Runtime
Expand Down