Created
April 18, 2019 10:48
-
-
Save allenyang79/ee205934f298092e870e1f0126376520 to your computer and use it in GitHub Desktop.
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
# vi: set ts=2 sw=2: | |
version: '3.4' | |
services: | |
rabbitmq: | |
image: rabbitmq:3.7-management | |
volumes: | |
- ./rabbitmq:/var/lib/rabbitmq | |
ports: | |
- 5672:5672 | |
- 15672:15672 | |
redis: | |
image: redis:5.0.4 | |
volumes: | |
- ./redis:/data | |
ports: | |
- 6379:6379 | |
flower: | |
build: | |
context: . | |
dockerfile: flower/dockerfile | |
volumes: | |
- ./app:/srv/proj/app | |
ports: | |
- 5001:5001 | |
command: bash -c "while true; do echo 'Hit CTRL+C'; sleep 1; done" | |
app: | |
build: | |
context: . | |
dockerfile: proj/dockerfile | |
volumes: | |
- ./app:/srv/proj/app | |
ports: | |
- 5000:5000 | |
command: bash -c "while true; do echo 'Hit CTRL+C'; sleep 1; done" | |
# cd app | |
# ./flower.sh | |
# clery flower -A app.main | |
# --broker=amqp://guest:guest@localhost:5672// | |
# --result-backend=redis://localhost:6379 | |
# --port=5555 |
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
# vi: set ft=dockerfile ts=2 sw=2: | |
FROM python:3.6 | |
MAINTAINER Allen Yang ([email protected]) | |
WORKDIR /srv/proj | |
ADD requirements.txt requirements.txt | |
RUN pip install -r requirements.txt | |
WORKDIR /srv/proj/app | |
CMD bash -c "while true; do echo 'Hit CTRL+C'; sleep 1; done" |
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
from celery import Celery | |
app = Celery('tasks', | |
broker='pyamqp://guest:guest@rabbitmq:5672//', | |
backend='redis://redis:6379' | |
) | |
@app.task | |
def add(x, y): | |
return x + y |
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
celery[redis]==4.3.0 | |
flower==0.9.3 |
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
#!/bin/bash | |
celery flower -A main \ | |
--broker=amqp://guest:guest@rabbitmq:5672// \ | |
--result-backend=redis://redis:6379 \ | |
--port=5001 |
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
#!/bin/bash | |
celery -A main worker --loglevel=info |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment