Forum Discussion

melismirza's avatar
melismirza
Copper Contributor
Jan 05, 2021

Problem with running a web app for container for multiple containers

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: 

 

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

Resources