clean-docker / Magento2

Docker Image to Magento 2 local development in Mac, Linux and Windows
https://hub.docker.com/r/rafaelcgstz/magento2/
MIT License
444 stars 251 forks source link

Feature Request:: RabbitMQ Container #83

Open NathanDayMF opened 5 years ago

NathanDayMF commented 5 years ago

Background

with the RabbitMQ module being downgraded from CE to OS would it be possible to add a RabbitMQ Container to this setup. I don't know whether this would be a separate container or something installed on the image if it is possible to do this just by modifying the docker-compose config then if someone could point me in the right direction (bit of a docker noob)

UAC

NathanDayMF commented 5 years ago

for anyone interested in this, think I've figured something out, want to do some more testing before pushing a PR

docker-compose.yml

rabbitmq:
    image: "rabbitmq:3-management"
    hostname: "rabbit"
    ports:
      - "15672:15672"
      - "5672:5672"
    labels:
      NAME: "rabbitmq"
    volumes:
      - ./rabbitmq-isolated.conf:/etc/rabbitmq/rabbitmq.config
    networks:
      - mgento2-docker-network

rabbitmq-isolated.conf

[
 {rabbit,
  [
   %% The default "guest" user is only permitted to access the server
   %% via a loopback interface (e.g. localhost).
   %% {loopback_users, [<<"guest">>]},
   %%
   %% Uncomment the following line if you want to allow access to the
   %% guest user from anywhere on the network.
   {loopback_users, []},
   {default_vhost,       "/"},
   {default_user,        "magento"},
   {default_pass,        "magento"},
   {default_permissions, [".*", ".*", ".*"]}
  ]}
]

app/etc/env.php

'queue' => [
    'amqp' => [
        'host' => 'rabbitmq',
        'port' => '5672',
        'user' => 'magento',
        'password' => 'magento',
        'virtualhost' => '/',
        'ssl' => false
    ]
]