How do I use both the node and docker orbs to install rabbitmq and run integration tests against it?

My old .circleci/config.yml (trimmed for focus) looks like this

version: 2

jobs:
  build:
    docker:
      - image: circleci/node:latest
        environment:
        - NODE_ENV: test

      - image: rabbitmq

    steps:
      - checkout

      - run:
          name: Install dockerize
          command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
          environment:
            DOCKERIZE_VERSION: v0.6.1

      - run:
          name: Install dependencies
          command: npm install

      - run:
          name: Wait for RabbitMQ to have started
          command: dockerize -wait tcp://localhost:5672 -timeout 1m

      - run:
          name: Integration Tests
          command: npm run test:integration

I’m in the process of upgrading all of my configs now to use the node + codecov orbs but there is no rabbitmq orb so I figured I’d just use docker.

I found the docker orb but can’t figure out how I’d use it in conjunction with the node orb to achieve the same result as above.

This is as far as I have got. Some obvious gaps in my knowledge.

version: 2.1

orbs:
  node: circleci/node@4.7.0
  codecov: codecov/codecov@3.2.0
  docker: circleci/docker@1.7.0

jobs:
  test:
    # somewhere in here start rabbitmq within docker.
    executor:
      name: node/default
      tag: 'current'
    steps:
      - checkout
      - node/install-packages
      - run:
          name: Javascript Linter
          command: npm run lint
      - run:
          name: Unit tests with code coverage
          command: npm run test:unit:cov
      # - run:
      #     name: Wait for RabbitMQ to have started
      #     command: dockerize -wait tcp://localhost:5672 -timeout 1m
      # - run:
      #     name: Integration Tests
      #     command: npm run test:integration

workflows:
  node-tests:
    jobs:
      - test:
          post-steps:
            - codecov/upload

Hi @davesag ,

I am not sure if this would work for your exact use case but you could use a config like below.

orbs: # adds orbs to your configuration
  node: circleci/node@4.7.0
  codecov: codecov/codecov@3.2.0
  docker: circleci/docker@1.7.0
      
jobs:
  build:
    docker: 
      - image: cimg/node:17.0.0
      - image: rabbitmq
    steps:
      - checkout 
      - docker/install-dockerize:
          version: v0.6.1
      - node/install-packages:
          override-ci-command: npm install
      - run:
          name: Wait for RabbitMQ to have started
          command: dockerize -wait tcp://localhost:5672 -timeout 1m

      - run:
          name: Integration Tests
          command: npm run test:integration          


version: 2.1
workflows:
  test_and_build:
    jobs:
      - build


Let me know if you have any follow up questions. Please also feel free to share a build link if you’d like.