I have below command to run my python file inside docker container:
docker run --rm --name=my_container --volume "/my_dir/:/host:z" myimage:latest python /host/api/my_file.py
I want to run it with VS code debug mode.
I tried looking at tutorials from VS code and Docker but most of the instructions are for Django/Flask and I don't understand how to modify it.
We can use command to create a Docker launch configuration to build and run your container in debug mode.Docker: Add Docker Files to Workspace...
Docker: Python - General
,Docker: Python - Django
, orDocker: Python - Flask
, as appropriate.You can also refer to this document for more details about docker and debug in docker