FAQ | This is a LIVE service | Changelog

Skip to content

Add (back) in debugpy

The webapp container forward port 5678 to allow debugging the container via debugpy. Unfortunately along the way it appears that actually installing and running debugpy inside the developer container got lost. Re-enable it via something akin to:

diff --git a/Dockerfile b/Dockerfile
index 96cc793..891c271 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -103,6 +103,7 @@ RUN set -e; \
 ENV DJANGO_SETTINGS_MODULE=project.settings.developer

 EXPOSE 8000
+ENTRYPOINT ["python3", "-Xfrozen_modules=off", "-m", "debugpy", "--listen", "0.0.0.0:5678"]
 CMD ["./manage.py", "runserver", "0.0.0.0:8000"]

 ###############################################################################
diff --git a/pyproject.toml b/pyproject.toml
index c83608a..4a61d80 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -41,6 +41,7 @@ pytest-django = "^4.5.2"
 pytest-docker-tools = "^3.1.3"
 pytest-env = "^1.0.0"
 tox = "4.23.0"
+debugpy = "^1.8.13"

   [tool.poetry.group.dev.dependencies.coverage]
   extras = [ "toml" ]

Thanks to @hwtb2 for discovering this.

Edited by Dr Rich Wareham