Skip to content

Commit

Permalink
Merge pull request #677 from mstriemer/celery-docker
Browse files Browse the repository at this point in the history
Support rabbitmq/celery with docker
  • Loading branch information
mstriemer committed Aug 26, 2015
2 parents 74a7f32 + e62be17 commit 10d9001
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
33 changes: 25 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
web:
worker: &worker
build: .
command: python manage.py runserver 0.0.0.0:8000
command: ./manage.py celeryd
entrypoint: ./scripts/start-docker.sh
ports:
- "8000:8000"
volumes:
- .:/code
links:
- memcached:memcached
- mysqld:mysqld
- elasticsearch:elasticsearch
- redis:redis
- memcached
- mysqld
- elasticsearch
- redis
- rabbitmq
environment:
- DATABASE_URL=mysql://root:@mysqld/olympia
- MEMCACHE_LOCATION=memcached:11211
Expand All @@ -19,6 +18,13 @@ web:
- MYSQL_ROOT_PASSWORD='docker'
- MYSQL_DATABASE='olympia'
- PYTHONDONTWRITEBYTECODE=1
- BROKER_URL=amqp://olympia:olympia@rabbitmq/olympia

web:
<<: *worker
command: python manage.py runserver 0.0.0.0:8000
ports:
- "8000:8000"

memcached:
image: memcached
Expand All @@ -34,3 +40,14 @@ elasticsearch:

redis:
image: redis

rabbitmq:
image: rabbitmq
hostname: olympia
name: olympia
expose:
- "5672:5672"
environment:
- RABBITMQ_DEFAULT_USER=olympia
- RABBITMQ_DEFAULT_PASS=olympia
- RABBITMQ_DEFAULT_VHOST=olympia
3 changes: 2 additions & 1 deletion lib/settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,8 @@ def JINJA_CONFIG():


# Celery
BROKER_URL = 'amqp://olympia:olympia@localhost:5672/olympia'
BROKER_URL = os.environ.get('BROKER_URL',
'amqp://olympia:olympia@localhost:5672/olympia')
BROKER_CONNECTION_TIMEOUT = 0.1
CELERY_RESULT_BACKEND = 'amqp'
CELERY_IGNORE_RESULT = True
Expand Down

0 comments on commit 10d9001

Please sign in to comment.