[Answered ]-Django channels and docker-compose error

1👍

Turns out I was using 1.0.0 version of daphne, meanwhile I was using an old version of django channels, and they are not compatible. Updating both fixed the error.

1👍

Your containers don’t has a link to each other. Try to unite them to network.

version: '2' 
  services:
    redis:
      image: redis:3.0-alpine
      networks:
       - django-network

    postgres:
        image: postgres
        networks:
         - django-network

    django:
        build: ../backend
        command:  python backend/manage.py runserver 0.0.0.0:8000
        volumes:
            - ../backend:/backend
        ports:
            - "8000:8000"
        depends_on:
            - postgres
            - redis
            - django-migration
        networks:
         - django-network

    django-migration:
        build: ../backend
        command: python backend/manage.py migrate
        volumes:
          - ../backend:/backend
        depends_on:
          - postgres
        networks:
         - django-network

    client:
        image: node
        command: bash -c "cd src && npm start"
        ports:
            - "3000:3000"
        networks:
         - django-network

     networks:
       tele-cluster-network:
         driver: bridge

Leave a comment