Skip to content

Conversation

@dturner5234
Copy link
Contributor

Configures container to run django with gunicorn
Overrides compose to use the dev server for local development

not tested very well locally

add command to compose to override container and run dev server for local environments
@wbprice
Copy link
Collaborator

wbprice commented Jan 27, 2026

--- a/compose.yml
+++ b/compose.yml
@@ -8,12 +8,12 @@ services:
     env_file:
       - path: .env
         required: false
-    command: python manage.py runserver --insecure 0.0.0.0:8000
+#    command: python manage.py runserver --insecure 0.0.0.0:8000
     environment:
       NPD_DJANGO_SECRET: ${NPD_DJANGO_SECRET:-_pth2#=k8-wf-_^t%2))it+3..8la^@@97^#ock7.v=@792w7}
-      DEBUG: ${DEBUG:-True}
+      DEBUG: ${DEBUG:-False}
       DJANGO_LOGLEVEL: ${DJANGO_LOGLEVEL:-INFO}
-      DJANGO_ALLOWED_HOSTS: "${DJANGO_ALLOWED_HOSTS:-['localhost','127.0.0.1','0.0.0.0']}"
+      DJANGO_ALLOWED_HOSTS: "${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0}"
       NPD_DB_ENGINE: ${NPD_DB_ENGINE:-django.contrib.gis.db.backends.postgis}
       NPD_DB_NAME: ${NPD_DB_NAME:-npd_development}
       NPD_DB_USER: ${NPD_DB_USER:-postgres}

After making these changes locally (to simulate running remotely):

Frontend assets are not loaded in the browser:

image

/fhir/docs continues to load.

image

Copy link
Collaborator

@wbprice wbprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frontend is not loading after this change when testing this change locally. From what I'm reading, gunicorn does not deliver static assets by default. Some folks recommend using nginx or whitenoise to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants