@@ -57,11 +57,6 @@ if ! command -v az &> /dev/null; then
5757 echo " Azure CLI not found. Please install it: https://docs.microsoft.com/cli/azure/install-azure-cli"
5858 exit 1
5959fi
60-
61- if ! command -v docker & > /dev/null; then
62- echo " Docker not found. Please install it: https://docs.docker.com/get-docker/"
63- exit 1
64- fi
6560echo " Prerequisites satisfied."
6661
6762echo " Please ensure you are logged into Azure before running this script."
@@ -280,43 +275,22 @@ if [ $? -ne 0 ]; then
280275fi
281276echo " Web and worker modules built."
282277
283- # Build and push Docker images to ACR
284- echo " Building and pushing Docker images to ACR..."
285-
286278# Web module
287- echo " Building web Docker image..."
288- docker build -t " ${AcrLoginServer} / ${ WebAppName} :latest" --file ./web/Dockerfile ./web
279+ echo " Building web Docker image in ACR ..."
280+ az acr build -t " ${WebAppName} :latest" -r $AcrName --file ./web/Dockerfile ./web
289281if [ $? -ne 0 ]; then
290- echo " Failed to build Web Docker image. Exiting."
282+ echo " Failed to build Web Docker image in ACR . Exiting."
291283 exit 1
292284fi
285+ echo " Web Docker image built and pushed to ACR."
293286# Worker module
294- echo " Building worker Docker image..."
295- docker build -t " ${AcrLoginServer} /${WorkerAppName} :latest" --file ./worker/Dockerfile ./worker
296- if [ $? -ne 0 ]; then
297- echo " Failed to build Worker Docker image. Exiting."
298- exit 1
299- fi
300- az acr login --name " $AcrName "
301- if [ $? -ne 0 ]; then
302- echo " Failed to log in to ACR. Exiting."
303- exit 1
304- fi
305- echo " Logged in to ACR."
306- echo " Pushing web Docker image to ACR..."
307- docker push " ${AcrLoginServer} /${WebAppName} :latest"
308- if [ $? -ne 0 ]; then
309- echo " Failed to push Web Docker image to ACR. Exiting."
310- exit 1
311- fi
312- echo " Web Docker image pushed to ACR."
313- echo " Pushing worker Docker image to ACR..."
314- docker push " ${AcrLoginServer} /${WorkerAppName} :latest"
287+ echo " Building worker Docker image in ACR..."
288+ az acr build -t " ${WorkerAppName} :latest" -r $AcrName --file ./worker/Dockerfile ./worker
315289if [ $? -ne 0 ]; then
316- echo " Failed to push Worker Docker image to ACR. Exiting."
290+ echo " Failed to build Worker Docker image in ACR. Exiting."
317291 exit 1
318292fi
319- echo " Worker Docker image pushed to ACR."
293+ echo " Worker Docker image built and pushed to ACR."
320294
321295# Create Container Apps with user-assigned managed identity for web module
322296echo " Creating Container App for web module..."
0 commit comments