4) Create a new run configuration to deploy application to Docker as shown on the following screenshots:

Tip

Be sure not to forget to add the Gradle tasks as a "before launch" action as shown at the very bottom of the screenshot.

Tip

The same is also possible for Docker Compose files. Just point the "Deployment" dropdown to the Docker Compose file.

5) Run the configuration and inspect the Docker container. A browser will open automagically and point to the REST endpoint. Within intelliJ you can access the containers console output, environment variables, port bindings etc.