I'am trying to connect web- application, deployed from one container, to rabbitmq, deployed at another container.
I created the following docker-compose:
version: '3' services: webapp: container_name: chat build: context: . depends_on: - broker ports: - "8080:8080" networks: - chat_network broker: container_name: rabbit_chat image: rabbitmq hostname: broker ports: - "5672:5672" - "15672:15672" healthcheck: test: ["CMD", "curl", "-f", "http://broker:5672"] interval: 30s timeout: 10s retries: 5 networks: - chat_network networks: chat_network: external: name: chat_network webapp is a service of web-application, at which I prescribe following rabbitmq-properties:
host = broker port = 15672 login = guest password = guest And this does not work.
I entered I my containers. Inside rabbit_chat-container I send request (webapp:8080) successfully. But when I send "curl broker:5672 --output - " inside chat-container, I received: "curl: (56) Recv failure: Connection reset by peer".
Inside rabbit_chat-container I run "ncat -v --listen 5672". And receive "Ncat: bind to :::5672: Address already in use. QUITTING."