Problem with running a web app for container for multiple containers

Copper Contributor

Hi,

I am trying to create a web app (for containers) for my Django application which uses PostGreSql as its database.  I have my own Azure Registry where I pushed my images. The configuration for the web app is: 

melismirza_0-1609881436464.png

 

And the configuration file is:

-----------------------------------------------------------------------------------------------------------

version: '3.7'

services:
db:
image: postgres:latest
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
volumes:
- postgres_data:/var/lib/postgresql/data/
web:
image: "covittertest:latest"
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
container_name: covid1
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
volumes:
postgres_data:

-----------------------------------------------------------------------------------------

Both of these images are present at the azure container registry.

 

It works correctly on my local machine with "docker compose up" command but the web app does not start on Azure. The error log is:

Error message
Unrecognized volume name found: .
Observation
This error happens when a volumes or volumeMounts section has a wrong name. Check the suggestions below to fix.
Suggestion
Make sure the volume name is correct in both container sections and the volume section.

 

Is there an additional configuration I have to make or are there any known bugs on this issue?

 

Thanks.

1 Reply

@melismirza 

 

Hi i'm wondering if it is not because of this :  

The volumes option maps the file system to a directory within the container. ${WEBAPP_STORAGE_HOME} is an environment variable in App Service that is mapped to persistent storage for your app

Can you have a look on this page to be sure you have the valid volume mount declaration ? 

Tutorial: Create a multi-container app - Azure App Service | Microsoft Docs