Using PyCharm Docker compose

I currently use PyCharm to do my Docker container development, and I want to add environment variables to my docker-compose yaml file.

Right now, PyCharm integrates with Docker so that it runs docker compose up when bringing up the container.

I would like to use Doppler variables for my ports like this:

version: "3.8"
services:
  tgfp-test-mongodb:
    build:
      context: .
      dockerfile: ./Dockerfile-Dev
    container_name: tgfp-test-mongodb
    ports:
      - "${MONGO_PORT}:${MONGO_PORT}"

But those variables are not set unless I don’t use the the native docker compose up command in my build config and make my own with doppler run -- compose blah blah

is there another way in PyCharm to get those variables in to my docker compose file when running?

Did you ever find a solution to this? We’re trying to setup our Docker pipelines with PyCharm and have had issues with Doppler every way we’ve tried.

Hi @johnsturgeon @rsimplify!

Sorry for not replying on this thread earlier! Did you all take a look at our docs surrounding Docker Compose?

Generally speaking, you should be able to use doppler run -- docker-compose up, but you’ll need to specify which variables get passed through to your containers in the docker-compose.yml file.

If that’s not working for you, could you elaborate a bit around what’s going wrong specifically?

Regards,
-Joel