bstiel / dockerize-celery-django-app

https://www.distributedpython.com/2018/06/12/celery-django-docker
https://www.distributedpython.com/2018/06/12/celery-django-docker/
47 stars 19 forks source link

environment variables #2

Open sri-vathsa opened 4 years ago

sri-vathsa commented 4 years ago

Can you explain what this line does? env_file: *envfile

I tried using the code in my project and it gives an error

yaml.composer.ComposerError: found undefined alias 'envfile'

fzumstein commented 4 years ago

These are yaml anchors, see: https://medium.com/@kinghuang/docker-compose-anchors-aliases-extensions-a1e4105d70bd

*envfile takes over the values that are defined above as &envfile

sri-vathsa commented 4 years ago

Cool, got it. Even after using the same env file I am getting this error from celery.

Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.

Any idea why this is happening?

lohedges commented 4 years ago

@sri-vathsa: This is because CELERY_BROKER in the env.env file should read. CELERY_BROKER_URL.