Last active
July 7, 2018 15:37
-
-
Save dkdndes/581be2c0e5297aecdf5d0e7c1e639053 to your computer and use it in GitHub Desktop.
Docker-Compose django-channels multichat example which allows scalable (async) workers
This file contains hidden or 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
# Example for a scalable worker for Andrew Goodwins django-channels multichat example | |
# from https://www.excella.com/insights/scaling-django-channels-with-docker | |
# | |
# Replace the existing docker-compose.yml at | |
# https://github.com/andrewgodwin/channels-examples/tree/master/multichat | |
# | |
# Follow the docker-compose steps for db migration, etc. and then | |
# | |
# $ docker-compose ps | |
# $ docker-compose scale worker=5 & | |
# $ docker-compose ps | |
version: "2" | |
services: | |
redis: | |
image: redis:latest | |
web: | |
build: . | |
command: daphne -b 0.0.0.0 -p 8000 multichat.asgi:channel_layer | |
volumes: | |
- .:/code | |
ports: | |
- "8000:8000" | |
links: | |
- redis | |
worker: | |
build: . | |
command: python manage.py runworker | |
volumes: | |
- .:/code | |
links: | |
- redis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the web service, the command call to Daphne defines than the asgi should call a variable
channel_layer
, where does that variable is declared inside the ASGI configuration file?