Skip to content

Commit 93c82af

Browse files
updates for custom deployment
1 parent 939b9eb commit 93c82af

3 files changed

Lines changed: 53 additions & 2 deletions

File tree

azure_custom.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ hooks:
8383
Write-Host "Image: ${backendImage}:latest" -ForegroundColor Cyan
8484
8585
az acr login --name $acrName 2>$null
86-
az acr build --registry $acrName --image "${backendImage}:latest" --file ./src/backend/ApiApp.Dockerfile ./src/backend --no-logs
86+
az acr build --registry $acrName --image "${backendImage}:latest" --file ./src/backend/ApiApp.Dockerfile ./src/backend
8787
if ($LASTEXITCODE -ne 0) {
8888
Write-Host "Failed to build container image" -ForegroundColor Red
8989
exit 1
@@ -151,7 +151,7 @@ hooks:
151151
echo "Registry: $ACR_NAME"
152152
echo "Image: $BACKEND_IMAGE:latest"
153153
154-
if az acr build --registry "$ACR_NAME" --image "$BACKEND_IMAGE:latest" --file ./src/backend/ApiApp.Dockerfile ./src/backend --no-logs; then
154+
if az acr build --registry "$ACR_NAME" --image "$BACKEND_IMAGE:latest" --file ./src/backend/ApiApp.Dockerfile ./src/backend; then
155155
echo "Container image built and pushed successfully!"
156156
else
157157
echo "Failed to build container image"

infra/scripts/package_frontend.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Package frontend for App Service deployment
2+
# This script is called by AZD during prepackage hook
3+
# Working directory is ./src/app/frontend-server (project directory)
4+
5+
Write-Host "Building React frontend..." -ForegroundColor Cyan
6+
7+
# Build React frontend (one level up)
8+
Push-Location ../frontend
9+
npm ci --loglevel=error
10+
npm run build -- --outDir ../frontend-server/static
11+
Pop-Location
12+
13+
Write-Host "Packaging frontend server..." -ForegroundColor Cyan
14+
15+
# Create dist folder
16+
mkdir dist -Force | Out-Null
17+
rm dist/* -r -Force -ErrorAction SilentlyContinue
18+
19+
# Copy required files to dist (node_modules excluded - App Service will npm install)
20+
cp -r static dist -Force
21+
cp server.js dist -Force
22+
cp package.json dist -Force
23+
cp package-lock.json dist -Force
24+
25+
Write-Host "Frontend packaged successfully!" -ForegroundColor Green

infra/scripts/package_frontend.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# Package frontend for App Service deployment
3+
# This script is called by AZD during prepackage hook
4+
# Working directory is ./src/app/frontend-server (project directory)
5+
6+
echo "Building React frontend..."
7+
8+
# Build React frontend (one level up)
9+
cd ../frontend
10+
npm ci --loglevel=error
11+
npm run build -- --outDir ../frontend-server/static
12+
cd ../frontend-server
13+
14+
echo "Packaging frontend server..."
15+
16+
# Create dist folder and copy files
17+
rm -rf ./dist
18+
mkdir -p ./dist
19+
20+
# Copy required files to dist (node_modules excluded - App Service will npm install)
21+
cp -r static ./dist/
22+
cp server.js ./dist/
23+
cp package.json ./dist/
24+
cp package-lock.json ./dist/
25+
26+
echo "Frontend packaged successfully!"

0 commit comments

Comments
 (0)