RubyMine RSpec run configuration with Dockerized Zeus

Context

I’m Dockerizing the development environment for a legacy Rails monolith, using a Dockerfile written for local env + docker-compose using that image to start different services.

Goal

I would like to run specs from RubyMine with just cmd+shift+R using Zeus – as it takes forever without.

Attempt

I have a service called test which starts zeus. Now if I do docker-compose exec test zeus rspec ./spec/dummy_spec.rb it runs very nicely and quickly.

I can not figure out how to tell RubyMine to do just that. It’d be best if debugger would also just work as if I were running things locally.

(I can run the spec with a remote interpreter, so that part is clear, but without Zeus it takes forever like I said.)

Question

Obviously, I’d like to know how to achieve my goal or hear about the best alternatives. 🙂

Source: Docker Questions