From 2a2cb5f92e32fbbc09fba8290252cf8c5440902b Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 17 Oct 2023 01:02:56 +0200 Subject: [PATCH] Collect static files on container start --- docker/entrypoint.sh | 2 ++ ljg/settings.py | 1 + 2 files changed, 3 insertions(+) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 267bd3a..f338fec 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -2,6 +2,8 @@ set -ex +rm -rf /app/static +python manage.py collectstatic python manage.py migrate if [ -z "$1" ] || [ "${1%-}" != "$1" ] diff --git a/ljg/settings.py b/ljg/settings.py index 40474ef..4c4f6dc 100644 --- a/ljg/settings.py +++ b/ljg/settings.py @@ -124,6 +124,7 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ +STATIC_ROOT = BASE_DIR / "static" STATIC_URL = "static/" # Default primary key field type