To configure Docker Compose as a remote interpreter, open the Settings/Preferences dialog &shortcut:ShowSettings;, go to the Languages & Frameworks | Ruby SDK and Gems page. Click The Add button and select New remote.... In the invoked dialog, select Docker Compose and specify the required settings.

Configure remote Ruby interpreter: Docker Compose

Learn more at Configure Docker as a remote interpreter.