Add persistency to RabbitMQ via Docker

This commit is contained in:
Thomas Sileo 2018-05-21 13:00:17 +02:00
parent 6e485fbad4
commit d3f6397999
3 changed files with 12 additions and 6 deletions

View file

@ -6,25 +6,31 @@ services:
- "${WEB_PORT}:5005" - "${WEB_PORT}:5005"
links: links:
- mongo - mongo
- rabbitmq - rmq
volumes: volumes:
- "${CONFIG_DIR}:/app/config" - "${CONFIG_DIR}:/app/config"
- "./static:/app/static" - "./static:/app/static"
environment: environment:
- MICROBLOGPUB_AMQP_BROKER=pyamqp://guest@rabbitmq// - MICROBLOGPUB_AMQP_BROKER=pyamqp://guest@rmq//
- MICROBLOGPUB_MONGODB_HOST=mongo:27017 - MICROBLOGPUB_MONGODB_HOST=mongo:27017
celery: celery:
build: . build: .
links: links:
- mongo - mongo
- rabbitmq - rmq
command: 'celery worker -l info -A tasks' command: 'celery worker -l info -A tasks'
environment: environment:
- MICROBLOGPUB_AMQP_BROKER=pyamqp://guest@rabbitmq// - MICROBLOGPUB_AMQP_BROKER=pyamqp://guest@rmq//
- MICROBLOGPUB_MONGODB_HOST=mongo:27017 - MICROBLOGPUB_MONGODB_HOST=mongo:27017
mongo: mongo:
image: "mongo:latest" image: "mongo:latest"
volumes: volumes:
- "${DATA_DIR}:/data/db" - "${DATA_DIR}/mongodb:/data/db"
rabbitmq: rmq:
image: "rabbitmq:latest" image: "rabbitmq:latest"
hostname: "my-rabbit"
environment:
- RABBITMQ_ERLANG_COOKIE=secretrabbit
- RABBITMQ_NODENAME=rabbit@my-rabbit
volumes:
- "${DATA_DIR}/rabbitmq:/var/lib/rabbitmq"