I'm running a RabbitMQ instance on Docker with this docker-compose.yml and no problem, it' working:
version: '3.7'
services:
my-rabbit:
image: imageAddress
hostname: my-rabbit
ports:
- "5672:5672"
- "15672:15672"
networks:
- testNetwork
networks:
testNetwork:
external: true
But I have to use that RabbitMQ with certificates to get connection over TLS.
I tried this way and certs folder contains certificates but got error:
version: '3.7'
services:
my-rabbit:
tty: true
image: imageAddress
environment:
- RABBITMQ_SSL_CERTFILE=/cert_rabbitmq/testca/cacert.pem
- RABBITMQ_SSL_KEYFILE=/cert_rabbitmq/server/cert.pem
- RABBITMQ_SSL_CACERTFILE=/cert_rabbitmq/server/key.pem
hostname: my-rabbit
ports:
- "5672:5672"
- "15672:15672"
volumes:
- /home/ilkaygunel/Desktop/certs:/cert_rabbitmq
networks:
- testNetwork
networks:
testNetwork:
external: true
The error is like below. It says old-style configuration file exists but I don't know what to do.
my-rabbit_1 | error: Docker configuration environment variables specified, but old-style (Erlang syntax) configuration file '/etc/rabbitmq/rabbitmq.config' exists
my-rabbit_1 | Suggested fixes: (choose one)
my-rabbit_1 | - remove '/etc/rabbitmq/rabbitmq.config'
my-rabbit_1 | - remove any Docker-specific 'RABBITMQ_...' environment variables
my-rabbit_1 | - convert '/etc/rabbitmq/rabbitmq.config' to the newer sysctl format ('/etc/rabbitmq/rabbitmq.conf'); see https://www.rabbitmq.com/configure.html#config-file
What should I do to use that certificate files?