Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#320] Optimized Docker image build and push process for frontend and…
… backend This commit optimizes the Docker image build and push process for the frontend and backend components of the application. It introduces a conditional check to ensure that Docker images are only built and pushed to the Amazon Elastic Container Registry (ECR) if there have been changes in their respective source directories. This is achieved by adding a helper function, check_image_on_ecr, which checks for the existence of the Docker image on ECR with the specified tag. If the image already exists, the build and push processes are skipped, thereby saving time and resources. Key Changes: * Conditional Build and Push: The build and push commands for both the frontend and backend Docker images now include a preceding check to determine if the image with the current tag already exists on ECR. * Helper Function: Introduced a new helper function, check_image_on_ecr, which utilizes the docker manifest inspect command to check for the image's presence on ECR. This function is used to conditionally execute the build and push commands based on the image's existence. * Efficiency Improvements: This approach minimizes unnecessary builds and uploads, especially useful in continuous integration and deployment (CI/CD) pipelines where build minutes and network bandwidth are valuable resources. This optimization ensures that our deployment process is both efficient and cost-effective, only utilizing resources when necessary to update the Docker images on ECR.
- Loading branch information