-1

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:

  1. 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?

  2. 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?

1 Answer 1

0

Regarding 1. currently Phpstorm has no such option, but there is related YouTrack feature request: https://youtrack.jetbrains.com/issue/WEB-64513

I have similar problem with laravel and vite. Some kind of workaround is to create separate container with just Node.js image then configure Phpstorm to run utility commands via this container and keep other services in main one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.