Enable docker containing debugging
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
@@ -29,4 +29,5 @@ pytest-django
|
||||
gunicorn
|
||||
rich
|
||||
bs4
|
||||
django-htmx
|
||||
django-htmx
|
||||
debugpy
|
||||
Reference in New Issue
Block a user