Phoenix + Docker + VScode environment for debbuging

Hello everybody.

I have set up my phoenix application using docker. My IDE is VScode. The problem is I can’t find a way to debug the application although it is running correctly inside the docker container. If I remove docker I am able to the bug with vscode using the following settings in launch.json file

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "mix_task",
            "name": "mix (Default task)",
            "request": "launch",
            "projectDir": "${workspaceRoot}"
        },
        {
            "type": "mix_task",
            "name": "mix phx.server",
            "request": "launch",
            "projectDir": "${workspaceRoot}",
            "task": "phx.server"
        }
    ]
}

As I understand then ElixirLS extension for the VScode is making it possible for me. But I would really like to run the application inside docker container(as I am doing with other projects) and still be able to use the debugging feature. How do you debug your phoenix application running in docker container?

I finally decided to drop the docker and use elixir installed on my system. Found a package called asdf which lets me easily switch between elixir versions. I am able to use the debugger feature on vscode and still use different elixir versions based on my project needs.

In addition to asdf itself, you can also use direnv to set environment variables as soon as you cd into a directory.