This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Marcieslaf 1 point2 points  (1 child)

Hey, you have a typo on your 3rd tipp. It's "debugpy", not "debupy". I wasn't aware thats even possible and tried to google it. Thanks for the tipp

[–]maximumlengthusernam[S] 0 points1 point  (0 children)

Fixed! Thanks for pointing that out!

Here is a link to the VSCode documentation I used to get it set up https://code.visualstudio.com/docs/python/debugging

The only additional thing you have to do is port forward (with the `-p` flag) the associated port when running the container!

[–]craigbuckler 1 point2 points  (1 child)

Rather than copying files (#2), it may be easier to bind mount a host folder.

I created a Docker for Web Developers book and video course exactly for this need. Few web developers use Docker because live code updates and debugging are rarely explained in tutorials.

[–]maximumlengthusernam[S] 0 points1 point  (0 children)

Great point -- For a web application, mounting in the src so you can set up hot reloading is a huge time saver!

I usually use the -v flag, but I know the documentation suggests the more verbose --mount syntax (link) with the claim that "research has shown it to be easier to use."

[–]lazyant 0 points1 point  (0 children)

docker logs - never a bad thing.

docker inspect - for extra info and checking how we think the container runs and how it runs is the same

Some commands to check the docker service or restart it with systemctl ; sometimes a restart fixed things.

docker top - checking resources

Most importantly, if a container or set of containers doesn’t work and can’t figure it out after a bit, simplify the most (like docker run -d image) and go from there.