Init container in multi-container azure webservice deployment.

Jesse Houwing 1 Reputation point MVP
2020-10-13T12:24:34.74+00:00

We have a docker-compose file with in it 4 containers:

  • Mongo
  • Web App
  • Web Api
  • Initialization

When using a multi-container webapp and using our compose file the app keeps restarting. We found this is due to the app being declared unhealthy because the init container stopped running (as it should).

We've tried configuring its (init container) restart policy to condition: none, but that didn't do the trick. The v2 restart: no syntax didn't help either.

How can I configure a multi-container deployment and have one container run only once and not have that restart the whole web-app constantly?

When we remove the init container, the app remains healthy.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
508 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,934 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2020-10-14T14:45:47.243+00:00

    Hi anonymous user,

    Multi-container support where a container is being used in a sidecar manner as you are doing is only available on Linux containers, not Windows. If your app service is being hosted in Windows container, please switch it over to Linux. See https://azure.microsoft.com/en-us/blog/app-service-adding-multi-container-capabilities-and-linux-support-for-app-service-environment/ for more information. Even though this blog post references using a Linux ASE, you should be fine with using an app service.

    I also noticed you posted the docker-compose on your stackoverflow question as well. If you are hosting your app inside a Linux app service, please let me know as this may be signs of an issue.

    Regards,
    Ryan

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.