diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d3f57e9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.9' + +services: + # Python app service + python_app: + build: + context: . + dockerfile: Dockerfile + image: stude_backend:latest + ports: + - "8000:8000" # Expose port 8000 for the web server + depends_on: + - redis_server # Ensure the Redis server starts before the Python app + environment: + - PYTHONBUFFERED=1 + command: ["python", "stude/manage.py", "runserver"] + + # Redis server service + redis_server: + image: redis:latest + ports: + - "6379:6379" # Expose default Redis port diff --git a/stude/config/asgi.py b/stude/config/asgi.py index 41094d5..e2bc07a 100644 --- a/stude/config/asgi.py +++ b/stude/config/asgi.py @@ -13,7 +13,6 @@ django_asgi_app = get_asgi_application() application = ProtocolTypeRouter({ "http": django_asgi_app, - # Just HTTP for now. (We can add other protocols later.) 'websocket': AuthMiddlewareStack( URLRouter( [re_path(r'ws/', URLRouter(api.routing.websocket_urlpatterns))] diff --git a/stude/config/settings.py b/stude/config/settings.py index 88c18ad..5d6b3f2 100644 --- a/stude/config/settings.py +++ b/stude/config/settings.py @@ -66,7 +66,7 @@ else: EMAIL_PORT = str(os.getenv('PROD_EMAIL_PORT')) EMAIL_USE_TLS = str(os.getenv('PROD_EMAIL_TLS')) -# Will need to install OSGeo4W for this! +# GDAL Library needed for Windows if os.name == 'nt': VIRTUAL_ENV_BASE = os.environ['VIRTUAL_ENV'] os.environ['PATH'] = os.path.join( @@ -74,8 +74,6 @@ if os.name == 'nt': os.environ['PROJ_LIB'] = os.path.join( VIRTUAL_ENV_BASE, r'.\Lib\site-packages\osgeo\data\proj') + ';' + os.environ['PATH'] -# To-do: Linux GDAL support here - INSTALLED_APPS = [ 'daphne', 'django.contrib.admin',