skip to Main Content

I’ve deployed a multi-container app to the Azure App Service with a minimalistic docker-compose file:

version: '3'
 
services:
  backend:
    image: myregistry.azurecr.io/backend:latest
    ports:
      - "3000:3000"

  frontend:
    image: myregistry.azurecr.io/frontend:latest
    ports:
      - "4173:4173"

Following the instructions here and considering this issue on how to specify non-standard (not 80/8080) ports, I set the WEBSITES_PORT value to the frontend port, i.e. 4173.

The deployment is successful, but instead of the frontend, the backend (in that case the Python fastapi swagger) is exposed.

Any ideas on why that is, and how to configure the deployment to show the frontend?

2

Answers


  1. Chosen as BEST ANSWER

    I've been able to solve this by following the instructions here:

    How do I know which container is internet accessible?

    • Only one container can be open for access
    • Only port 80 and 8080 is accessible (exposed ports)

    Here are the rules for determining which container is accessible - in the order of precedence:

    • Application setting WEBSITES_WEB_CONTAINER_NAME set to the container name
    • The first container to define port 80 or 8080
    • If neither of the above is true, the first container defined in the file will be accessible (exposed)

    More specifically, I switched to using port 8080 for the frontend and changed the order in the docker-compose file to have the frontend service at the top.


  2. Have you tried using a port other than 4173? This port seems to be classified as reserved, so Azure may be blocking the allocation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search