PyCharm 2024. 3.5 Django docker compose set project path in container

I have a docker compose Django project that runs fine in a terminal on the server and I'm trying to set up PyCharm for development debugging. In my docker-compose.py I have a volume mapping the project root on the host file system to the container:

Volumes:

- ../:/code

So I would expect that when the project is run/debug it would build the root project directory in the container directory /code but instead it is in /opt/project directory.

Docker is running on Ubuntu 24.04 on an ESXi 8 VM.

How can I set the path of the project in the container to use /code and not /opt/project?

I've tried path mapping in the run/debug configurations

/opt/my_app=/code

setting the working directory

/opt/my_app

I've also spent hours looking online for any information regarding this, but most of what I can find is for older versions of PyCharm and is no longer valid.

Вернуться на верх