I am trying to integrate celery, rabbitmq with my django app and run it using docker, below is my docker-compose.yml file:
version: '3.4'
services:
db:
image: postgres:13.4
env_file:
- ./docker/env.db
ports:
- 5432:5432
app: &app
build:
context: .
dockerfile: ./docker/Dockerfile
env_file:
- ./docker/env.db
- ./.env
volumes:
- .:/opt/code
ports:
- 8000:8000
- 3000:3000
depends_on:
- db
- rabbitmq
command: bash ./scripts/runserver.sh
rabbitmq:
image: rabbitmq:3.7-alpine
container_name: 'rabbitmq'
ports:
- "5672:5672"
celery:
<<: *app
command: celery -A app worker --loglevel=info
ports: []
depends_on:
- rabbitmq
However,I am getting this error:
celery_1 | [2022-01-22 07:03:36,373: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.
celery_1 | Trying again in 6.00 seconds... (3/100)
What should I do?
Help would be much appreciated.
Thank you!