JetBrains / phpstorm-workshop

Code for the PhpStorm workshop
https://www.jetbrains.com/phpstorm
Apache License 2.0
291 stars 70 forks source link

docker-compose relative file path. Error: Can't read compose file project/./v2/../../v2/docker-compose.yml #58

Open max-baranikov opened 4 years ago

max-baranikov commented 4 years ago

I have docker-compose.yml file in the root of my project and I can run it directly from terminal with docker-compose up But when I try to add a docker debug configuration from docker-compose file, I cannot set proper absolute path. When I add path do docker-compose.yml, everything is fine.

image

But when I press OK, the IDE replace it with a relative path based on my project dir, like this:

image

And obviously this configuration cannot run with the following error:

Deploying 'Compose: v2'...
Failed to deploy 'Compose: v2': Can't read compose file at /path/to/my/project/./v2/../../v2/docker-compose.yml

How can I set the absolute path, or make this relative path works in IDE?

emrzv commented 3 years ago

Our apologies for such a delayed reply. So, we don't use absolute paths in run configurations so that they still worked if you copied the project to a different location. Instead, we consider the path to be relative to the project root. So, in your case, if the docker-compose.yml file is located in the project root as you claim, it's supposed to be something like ./docker-compose.yml. I can't reproduce the issue locally too. Is it still happening in newer PhpStorm versions for you?