ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
551 stars 129 forks source link

Docker support #131

Open benjamint-bsquare opened 3 years ago

benjamint-bsquare commented 3 years ago

Requesting support for Docker and Docker Compose Run/Debug configuration. (EnvFile is great)

ashald commented 3 years ago

I'm not sure those particular run configuration expose necessary extension points, but I'd welcome such contribution!

dimitri-b commented 1 year ago

Firstly, this plugin is a great idea and sorely needed. I managed to get EnvFile partially working with Docker container as Python interpreter. But there are a few problems:

  1. With PyCharm built-in env vars form, setting PYTHONPATH=foo/bar simply prepends that value to the rest of the existing var. When using EnvFile, it appears just to overwrite the whole var with the value, causing Python import errors.
  2. To authenticate with Google Cloud using host OS stored credentials, that directory can be mounted on the container during run (via PyCharm run config form), which works fine with EnvFile disabled, but with it enabled, the trick somehow stops working. These are what I have encountered so far. Unfortunately, I don't know enough Java to help.
grzn commented 1 year ago

How did you get it to work with the docker container?

dimitri-b commented 1 year ago

How did you get it to work with the docker container?

I wouldn't say I got it properly working. With Docker image set as Python interpreter in PyCharm and EnvFile plugin enabled, I managed to run Python modules without errors. That required some tweaks and adjustments around the issues I mentioned initially. So I guess it just (partially) works.