-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a variant of liveblog running on RabbitMQ.
- Loading branch information
1 parent
4fe2da2
commit 5442457
Showing
14 changed files
with
106 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.5 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV RABBITMQ_HOST "rabbitmq" | ||
ENV DJANGO_SETTINGS_MODULE "liveblog.settings.rabbitmq" | ||
ENV PYTHONPATH "/code" | ||
RUN mkdir /code | ||
WORKDIR /code | ||
ADD . /code/ | ||
RUN pip install -r requirements/rabbitmq.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FROM python:3.5 | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV REDIS_HOST "redis" | ||
ENV DJANGO_SETTINGS_MODULE "liveblog.settings.redis" | ||
RUN mkdir /code | ||
WORKDIR /code | ||
ADD . /code/ | ||
RUN pip install -r requirements.txt | ||
RUN pip install -r requirements/redis.txt | ||
RUN python manage.py migrate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: "2" | ||
services: | ||
rabbitmq: | ||
image: rabbitmq:management | ||
ports: | ||
- "15672:15672" | ||
web: | ||
build: | ||
context: . | ||
dockerfile: compose/Dockerfile.rabbitmq | ||
command: daphne -b 0.0.0.0 -p 8000 liveblog.asgi:channel_layer | ||
volumes: | ||
- .:/code | ||
depends_on: | ||
- rabbitmq | ||
ports: | ||
- "8000:8000" | ||
worker: | ||
build: | ||
context: . | ||
dockerfile: compose/Dockerfile.rabbitmq | ||
command: django-admin runworker | ||
volumes: | ||
- .:/code | ||
depends_on: | ||
- rabbitmq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from .base import * | ||
|
||
rabbitmq_host = os.environ.get('RABBITMQ_HOST', 'localhost') | ||
rabbitmq_url = 'amqp://guest:guest@%s:5672/%%2F' % rabbitmq_host | ||
|
||
# Channel layer definitions | ||
# http://channels.readthedocs.org/en/latest/deploying.html#setting-up-a-channel-backend | ||
CHANNEL_LAYERS = { | ||
"default": { | ||
# This example app uses the Rabbitmq channel layer implementation asgi_rabbitmq | ||
"BACKEND": "asgi_rabbitmq.RabbitmqChannelLayer", | ||
"CONFIG": { | ||
"url": rabbitmq_url, | ||
}, | ||
"ROUTING": "liveblog.routing.channel_routing", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from .base import * | ||
|
||
redis_host = os.environ.get('REDIS_HOST', 'localhost') | ||
|
||
# Channel layer definitions | ||
# http://channels.readthedocs.org/en/latest/deploying.html#setting-up-a-channel-backend | ||
CHANNEL_LAYERS = { | ||
"default": { | ||
# This example app uses the Redis channel layer implementation asgi_redis | ||
"BACKEND": "asgi_redis.RedisChannelLayer", | ||
"CONFIG": { | ||
"hosts": [(redis_host, 6379)], | ||
}, | ||
"ROUTING": "liveblog.routing.channel_routing", | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Django>=1.9 | ||
channels>=0.10 | ||
git+https://github.com/proofit404/asgi_rabbitmq.git@524e9f12bad9fcb4f24c7345a1a6cd8a264aa494#egg=asgi_rabbitmq |
File renamed without changes.