Enable docker containing debugging

This commit is contained in:
Ross
2022-11-14 13:48:23 +00:00
parent b24fda6970
commit 02eb812122
4 changed files with 16 additions and 1 deletions
+2
View File
@@ -4,6 +4,7 @@ services:
web:
build: ./rad
command: python manage.py runserver 0.0.0.0:8000
#command: pip install -r requirements.txt
volumes:
- ./rad/:/usr/src/rad/
- ../rts/:/usr/src/rad/rts
@@ -12,6 +13,7 @@ services:
- ./static:/usr/src/static
ports:
- 8000:8000
- 3459:3459
env_file:
- ./.env.dev
db:
+10
View File
@@ -1,9 +1,19 @@
#!/usr/bin/env python
import os
import sys
from django.conf import settings
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rad.settings")
# Set up debugger if we are running in a container
if os.environ.get('RUN_MAIN'):
if settings.DEBUG_CONTAINER:
import debugpy
print("DEBUG LISTEN")
debugpy.listen(("0.0.0.0", 3459))
try:
from django.core.management import execute_from_command_line
except ImportError:
+2
View File
@@ -297,6 +297,8 @@ EMAIL_USE_SSL = True
ADMINS = [("Ross","ross@xkjq.uk")]
DEBUG_CONTAINER = False
try:
from .settings_local import *
except ImportError:
+2 -1
View File
@@ -29,4 +29,5 @@ pytest-django
gunicorn
rich
bs4
django-htmx
django-htmx
debugpy