From 03fd7e8d9d77ccd0e0a183c00482d7f3b8ed051b Mon Sep 17 00:00:00 2001 From: Daoud Clarke Date: Sat, 28 Oct 2023 16:38:56 +0100 Subject: [PATCH] Collect static files --- Dockerfile | 2 +- mwmbl/main.py | 3 ++- mwmbl/settings_prod.py | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7fd2103..003657a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ COPY --from=builder /venv /venv COPY --from=front-end /front-end/dist /front-end-build ADD nginx.conf.sigil /app -ADD app.json /app +# ADD app.json /app # Set up a volume where the data will live VOLUME ["/data"] diff --git a/mwmbl/main.py b/mwmbl/main.py index aba3fdc..166baec 100644 --- a/mwmbl/main.py +++ b/mwmbl/main.py @@ -5,7 +5,8 @@ from django.core.management import call_command def run(): django.setup() - call_command('migrate') + call_command("collectstatic", "-c") + call_command("migrate") uvicorn.run("mwmbl.asgi:application", host="0.0.0.0", port=5000) diff --git a/mwmbl/settings_prod.py b/mwmbl/settings_prod.py index 7893be5..b6adcc2 100644 --- a/mwmbl/settings_prod.py +++ b/mwmbl/settings_prod.py @@ -8,6 +8,9 @@ from mwmbl.settings_common import * SECRET_KEY = os.environ["DJANGO_SECRET_KEY"] +STATIC_ROOT = "/app/static/" + + DATABASES = {'default': dj_database_url.config(default=os.environ["DATABASE_URL"])} DEBUG = True # TODO set back to False