Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support rabbitmq/celery with docker #677

Merged
merged 1 commit into from
Aug 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -983,7 +983,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