docker image deploy with redis

Giorgi Kurdadze 0 Reputation points
2023-08-10T19:04:15.2666667+00:00

Sorry I'm I'm in wrong place

I'm using docker image deployment for my django project,

this is docker-compose:

version: '3'
services:
  web:
    build:
      context: .
      dockerfile: Dockerfile
    command: gunicorn --bind 0.0.0.0:8000 --workers 4 ga_core.wsgi:application
    volumes:
      - .:/app
    ports:
      - "8000:8000"
    depends_on:
      - redis
    networks:
        - connections
  redis:
    restart: unless-stopped
    image: "redis:latest"
    networks:
        - connections
#tried without networks too
networks:
  connections:
    name: connections
    driver: bridge

settings:

CACHES = {
'default': { 'BACKEND': 'django.core.cache.backends.redis.RedisCache', 'LOCATION': 'redis://redis:6379/1',     } }

every time I get that, (I tried almost everything):

Error -2 connecting to redis:6379. Name or service not known.

is there anything I'm missing?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 24,951 Reputation points Microsoft Employee Moderator
    2023-08-11T04:29:22.3133333+00:00

    @Giorgi Kurdadze Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.
    Could you please confirm are you trying to deploy the above shared docker-compose file Azure Webapps or any other Azure service?

    If you are trying to deploy in Azure App service, then currently multi-container app using docker compose configuration in app service is in preview and have set of limitations like other ports 80 and 8080,networks are ignored.

    User's image

    Feel free to reach back to me if you have any further questions on this.


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.