I have an application that uses a Postgres database and RabbitMQ as a message broker. For the database I’m using the convenience image cimg/postgres which works perfectly fine. For RabbitMQ there 's no convenience image as far as I can tell. I’m hence pulling it and starting it from docker hub like this;
dev-run-system-test: resource_class: xlarge docker: - image: cimg/python:3.10.7 environment: PG_TEST_PORT: 5432 - image: cimg/postgres:15.4 environment: POSTGRES_USER: test_user POSTGRES_PASSWORD: test_password POSTGRES_DB: test_db POSTGRES_PORT: 5432 - image: rabbitmq:3.11.23 environment: RABBITMQ_DEFAULT_USER: dev_user RABBITMQ_DEFAULT_PASS: dev_user steps: - run-system-test: script: scripts/system-test.sh
The container itself seems to be starting just fine according to the logs but I cannot connect to it from my python application. Which is kind of expected as I haven’t exposed any ports. However, is there a way to to this? If not, how can I approach this problem to test my application with the help of a RabbitMQ container?