IntelliJ IDEA (and PyCharm with others) support remote deployment, debugging, and execution in "Tools → Deployment". This allows running remote SDK as well, so the workflow is identical to local development.
This works until development is containerized. In this case, you have to execute (run or debug) inside a container on a remote server.
For Docker containers:
Deployment is simple: Set up SFTP to the remote server and automatically upload files there. Files are stored in folders. Folders are attached to Docker containers as volumes. Restart the app inside the container.
Setting up a remote SDK is not clear because this SDK is inside the remote container. IntelliJ IDEA has Docker plugin that supports remote SDKs from Docker containers:
I guess I should set up a new Docker server by connecting IDEA to the remote Docker daemon via TCP socket.
Several sources explain how to configure the remote API at various stages:
- Put Docker on a network socket: How do I enable the remote API for dockerd
- Protect the socket: Protect the Docker daemon socket
- Open it to the external world: How to open a specific port such as 9090 in Google Compute Engine
- Add the server:socket to the new SDK configuration in the picture above.
Where can I get a more detailed guide on connecting IDEA to the remote Docker? For example, where do I get the certificate, what ports should I open on the remote machine, and how to set it up securely if the remote server is an AWS/GCP machine?