I'm working on a project using PhpStorm and Docker to manage development environments. Normally, I configure PhpStorm to use PHP running in a Docker container, and it works perfectly, whether it's for running linters, quality assurance tools, or other tasks.
Now, I'm working on a project that also involves frontend development with Angular and TypeScript, which requires Node.js. To simplify my setup, I created a Docker image that combines PHP, Node.js, and all necessary dependencies. However, I've run into two issues when trying to configure PhpStorm to work with this setup:
Re-using an already running Docker container
For PHP workflows, PhpStorm allows me to connect to an already running Docker container. However, when I try to set up Node.js using the Node.js Remote plugin, PhpStorm always creates a new container instead of using the one that’s already running. This significantly slows down the workflow. Is there a way to configure PhpStorm to use an existing Node.js container rather than create a new one?
Configuring ESLint with directory mappings
I use ESLint as part of my development process, but I couldn’t manage to configure it properly in PhpStorm. Specifically, I need to manually set the working directory and ESLint configuration file path inside the Docker container. In PHP workflows, PhpStorm allows me to map the local file system to the container’s file system, but I couldn’t find a similar feature for ESLint. How can I set proper directory mappings between my local project and the Docker container to make ESLint work in this setup?
What's the best way to configure PhpStorm for Node.js and ESLint under these circumstances? Are any additional plugins or steps are required?