Skip to content

Commit 4b59998

Browse files
[WEB-5592] chore: add static files update settings for static files support (#8251)
* chore: add static files collection and update settings for static files support * chore: add WhiteNoise middleware for static file handling * chore(deps): upgrade WhiteNoise to version 6.11.0 and add static file reverse proxy in Caddyfile
1 parent f70384b commit 4b59998

File tree

5 files changed

+8
-1
lines changed

5 files changed

+8
-1
lines changed

apps/api/bin/docker-entrypoint-api.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ python manage.py create_bucket
3232
# Clear Cache before starting to remove stale values
3333
python manage.py clear_cache
3434

35+
# Collect static files
36+
python manage.py collectstatic --noinput
37+
3538
exec gunicorn -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile -

apps/api/plane/settings/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"django.contrib.auth",
3737
"django.contrib.contenttypes",
3838
"django.contrib.sessions",
39+
"django.contrib.staticfiles",
3940
# Inhouse apps
4041
"plane.analytics",
4142
"plane.app",
@@ -58,6 +59,7 @@
5859
MIDDLEWARE = [
5960
"corsheaders.middleware.CorsMiddleware",
6061
"django.middleware.security.SecurityMiddleware",
62+
"whitenoise.middleware.WhiteNoiseMiddleware",
6163
"plane.authentication.middleware.session.SessionMiddleware",
6264
"django.middleware.common.CommonMiddleware",
6365
"django.middleware.csrf.CsrfViewMiddleware",
19.3 KB
Loading

apps/api/requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ celery==5.4.0
2121
django_celery_beat==2.6.0
2222
django-celery-results==2.5.1
2323
# file serve
24-
whitenoise==6.6.0
24+
whitenoise==6.11.0
2525
# fake data
2626
faker==25.0.0
2727
# filters

apps/proxy/Caddyfile.ce

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
reverse_proxy /auth/* api:8000
1717

18+
reverse_proxy /static/* api:8000
19+
1820
reverse_proxy /{$BUCKET_NAME}/* plane-minio:9000
1921

2022
reverse_proxy /* web:3000

0 commit comments

Comments
 (0)