question

LogeeswaranSaranyaCognizant-5765 avatar image
0 Votes"
LogeeswaranSaranyaCognizant-5765 asked ajkuma-MSFT commented

Access multiple ports in Docker-compose, Azure web app for container.

We have docker-compose file with images for UI, DB and NLP Engine.

Default port 8080 is used for incoming requests to the app.
We need to access DB and NLP containers serving in 27017 and 5005 respectively.

Does the Azure web app for Container - docker-compose support this?



azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered ajkuma-MSFT commented

@LogeeswaranSaranyaCognizant-5765,

Azure App Service only exposes ports 80 and 443. Yes, incoming requests from client would just be over 443/80 which should be mapped to the exposed port of the container.
App Service will attempt to detect which port to bind to your container, but you can also use the WEBSITES_PORT app setting and configure it with a value for the port you want to bind to your container.

Web App for Containers currently allows you to expose only one port to the outside world. That means that your container can only listen for HTTP requests on a single port.

From Docker compose configuration stand-point : Ports other than 80 and 8080 are ignored.
Kindly see the following lists show supported and unsupported Docker Compose configuration options:

Document section : Docker Compose options



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@LogeeswaranSaranyaCognizant-5765,

Additionally, one of your containers will represent the actual website that users should see when they browse to your Web App's URL. That container is referred to as the "web" container. Check the doc on the specific logic to determine which container is the "web" container.
Please check this doc for more details.

Also, please note Multi-container is in preview.
It's not recommended to use database containers in a production environment. The local containers aren't scalable. Instead, you'll use Azure Database for MySQL which can be scaled.


0 Votes 0 ·