diff --git a/Dockerfile b/Dockerfile index 6840c84..f0a91b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,11 +49,9 @@ RUN mkdir -p /app/staticfiles /app/media && \ # Build Tailwind CSS and collect static files during build (before switching to django user) # This ensures static files are available even if collectstatic fails at runtime -# Use minimal build settings that don't require database or external dependencies -RUN DJANGO_SETTINGS_MODULE=django_project.settings.build \ - python manage.py tailwind install && \ - python manage.py tailwind build && \ - python manage.py collectstatic --noinput --clear || echo "Static collection failed during build, will retry at runtime" +RUN DJANGO_SETTINGS_MODULE=django_project.settings.build python manage.py tailwind install || echo "Tailwind install failed" +RUN DJANGO_SETTINGS_MODULE=django_project.settings.build python manage.py tailwind build || echo "Tailwind build failed" +RUN DJANGO_SETTINGS_MODULE=django_project.settings.build python manage.py collectstatic --noinput --clear || echo "Static collection failed during build, will retry at runtime" # Fix permissions after collecting static files RUN chown -R django:django /app/staticfiles && \ diff --git a/django_project/settings/build.py b/django_project/settings/build.py index 6952b09..d28dd7d 100644 --- a/django_project/settings/build.py +++ b/django_project/settings/build.py @@ -18,11 +18,13 @@ STATIC_ROOT = BASE_DIR / 'staticfiles' STATICFILES_DIRS = [BASE_DIR / 'static'] STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' -# Minimal required apps for static file collection +# Required apps for static file collection (include all apps that have static files) INSTALLED_APPS = [ 'django.contrib.staticfiles', 'tailwind', + 'django_browser_reload', 'theme', # Our Tailwind theme app + 'apps.core', # Include our apps in case they have static files ] # Tailwind CSS Configuration diff --git a/entrypoint.sh b/entrypoint.sh index 964d4ac..7ab06ab 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,9 +24,6 @@ python manage.py setup_social_apps || { echo "Skipping Tailwind build at runtime (already built during Docker build)..." # Note: Tailwind CSS is built during the Docker build process to avoid permission issues -echo "🔍 Debugging Django settings..." -python manage.py debug_settings - echo "Collecting static files..." # Handle potential permission issues with Docker volumes # Try to collect static files, but don't fail if it doesn't work since we have build-time static files