Create a multi-container app using a Docker Compose to Azure App service

Posted by Anuraj on Tuesday, September 8, 2020 Reading time :1 minute

Azure Docker

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.

Create Web App

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.

version: '3.4'

services:
  todoapi:
    image: anuraj/todoapi
    ports:
      - 80
    depends_on: 
      - db
  db:
    image: anuraj/todosql
    environment: 
      SA_PASSWORD: "Password@12345"
      ACCEPT_EULA: "Y"

This file will be displayed in the Window.

Create Web App - Docker configuration

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.

Container Settings

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.

Log Stream 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.

Happy Programming :)

What do you think? I would like to hear your thoughts, suggestions, and questions in the comments section below.


Similar Posts


Did you like this article? Share it with your friends

Facebook Twitter Google+ LinkedIn Reddit StumbleUpon



Translate
Subscribe
BMC logoBuy me a coffee


Copyright © 2020 - Anuraj P. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Hosted with ❤ by GitHub