mirror of
https://github.com/thecyberlearn/modern-django-starter.git
synced 2026-08-18 16:52:55 +00:00
- Add build-time static file collection to handle Docker volume permission issues - Create django_project/settings/build.py for minimal build-time settings - Enhance entrypoint.sh with graceful fallback when collectstatic fails - Improve Dockerfile permissions and add Tailwind build during Docker build - Add WARP.md with comprehensive development guidance - Include test-docker-build.sh script for local testing - Update docker-compose.dokploy.yml with build optimizations Fixes permission denied errors during static file collection on Dokploy deployments.
43 lines
1.1 KiB
Python
43 lines
1.1 KiB
Python
"""
|
|
Minimal settings for Docker build process (static file collection)
|
|
This file contains only the necessary settings for collectstatic to work during build.
|
|
"""
|
|
import os
|
|
from pathlib import Path
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
|
|
|
# Security settings (minimal for build)
|
|
SECRET_KEY = 'build-time-secret-key-not-for-production'
|
|
DEBUG = False
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
# Static files settings (primary purpose of this file)
|
|
STATIC_URL = '/static/'
|
|
STATIC_ROOT = BASE_DIR / 'staticfiles'
|
|
STATICFILES_DIRS = [BASE_DIR / 'static']
|
|
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
|
|
|
# Minimal required apps for static file collection
|
|
INSTALLED_APPS = [
|
|
'django.contrib.staticfiles',
|
|
'tailwind',
|
|
'theme', # Our Tailwind theme app
|
|
]
|
|
|
|
# Tailwind CSS Configuration
|
|
TAILWIND_APP_NAME = 'theme'
|
|
|
|
# Minimal database config (not used but required by Django)
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': ':memory:',
|
|
}
|
|
}
|
|
|
|
# Disable middleware and other unnecessary components for build
|
|
MIDDLEWARE = []
|
|
ROOT_URLCONF = None
|
|
USE_TZ = True
|