Create a multi-container app using a Docker Compose to Azure App service
This post is about deploying a multi-container app to azure app service using Docker compose. To get started let us create an App Service with Docker first. In the portal, click on Create New, search for Web App and select the Web App option.
In the first screen, you need to choose the Docker Container option for Publish configuration, select Linux or Windows. For this post I am using Linux. And Pricing Plan I choose the Basic B1 plan - which is free for one month.
Next in the Docker configuration tab, select the
Docker Compose (Preview) option,
Docker Hub as the Image Source. As my images are public, keep the access type as Public. Next select the
docker-compose.yml file. Here is my docker-compose.yml file.
This file will be displayed in the Window.
Next click on the Review and Create button to create the resource. It might take some time to deploy the containers. Once the deployment is completed you can browse the app and verify.
You can find more information and logs how the deployment is working from the
Container Settings blade from the App Service menu. You can modify the docker-compose file in this section if required.
Since Application Insights not available, troubleshooting issues will be using the Log Stream feature of App Services. So you need to enable the App Service Logs. Once you enable it, click on the Log Stream. You will be able to see the log information.
In this example the app won’t run properly - the app requires more than 2000MB memory since I am using SQL Server docker image. If you upgrade to a different plan it will work properly.
Here is some resources which will help you.
- Create a multi-container (preview) app using a Docker Compose configuration - Deploying a Wordpress app with MySql to Azure App Service
- Tutorial: Create a multi-container (preview) app in Web App for Containers
Happy Programming :)