Answer the question
In order to leave comments, you need to log in
Is there an easy way to add RabbitMQ to an existing docker project?
For local development I use docker, although I am afraid of it, I wake up at night, scream, but do not give up. Through trial and error, I set up the right environment. Nothing special PHP, MySQL, Mongo, necessary libs in PHP , Nginx. There is a docker-compose, an images directory, it contains a PHP folder with a Dockerfile (it describes any necessary for the normal operation of PHP). mysql and hosts directories.
I would like to try to work with queues and workers. I am learning RabbitMQ. There are no questions about how to use it for simple things, but all attempts to shove STE happiness into the docker are still in vain.
I tried to do a manual using this manual , but to no avail.
Maybe there is an easier way to install this miracle or a step-by-step guide for pensioners?
Thanks
Answer the question
In order to leave comments, you need to log in
In general, here is a config wound up:
version: '2.0'
services:
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: rabbitmq
volumes:
- ./.docker/rabbitmq/etc/:/etc/rabbitmq/
- ./.docker/rabbitmq/data/:/var/lib/rabbitmq/
- ./.docker/rabbitmq/logs/:/var/log/rabbitmq/
ports:
- "5672:5672"
- "15672:15672"
nginx:
image: nginx:latest
ports:
- "8000:80"
# монтируем директории, слева директории на основной машине, справа - куда они монтируются в контейнере
volumes:
- ./hosts:/etc/nginx/conf.d
- ./www:/var/www
- ./logs:/var/log/nginx
links:
- php
php:
# у нас свой образ для PHP, указываем путь к нему и говорим что его надо собрать
build: ./images/php
links:
- mysql
- rabbitmq
volumes:
- ./www:/var/www
mysql:
image: mariadb
ports:
- "3306:3306"
volumes:
- ./mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: secret
environment:
PMA_HOST: mysql
MYSQL_USERNAME: root
MYSQL_ROOT_PASSWORD: secret
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question