mirror of
https://github.com/thecyberlearn/modern-django-starter.git
synced 2026-08-18 16:52:55 +00:00
- Build Tailwind CSS locally to create missing styles.css file
- Improve Docker build process to properly install and build Tailwind
- Update build.py settings to include all required apps
- Remove debugging from entrypoint script
The 500 error was caused by missing css/dist/styles.css file that the
{% tailwind_css %} template tag was trying to load. Now the file exists
and the Docker build process ensures it's created during build.
46 lines
1.3 KiB
Bash
Executable File
46 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "Waiting for PostgreSQL..."
|
|
sleep 5
|
|
|
|
echo "Running migrations..."
|
|
python manage.py migrate --noinput || {
|
|
echo "Migration failed!"
|
|
exit 1
|
|
}
|
|
|
|
echo "Creating default groups..."
|
|
python manage.py create_groups || {
|
|
echo "Group creation failed!"
|
|
exit 1
|
|
}
|
|
|
|
echo "Setting up social applications..."
|
|
python manage.py setup_social_apps || {
|
|
echo "Social apps setup failed!"
|
|
exit 1
|
|
}
|
|
|
|
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 "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
|
|
set +e
|
|
python manage.py collectstatic --noinput --clear 2>/dev/null
|
|
if [ $? -eq 0 ]; then
|
|
echo "✅ Static files collected successfully!"
|
|
else
|
|
echo "⚠️ Static file collection failed due to permission issues."
|
|
echo "This is common with Docker volume mounts on deployment platforms."
|
|
echo "The application will use static files collected during the Docker build."
|
|
echo "Your app will work normally with build-time static files."
|
|
fi
|
|
|
|
# Re-enable exit-on-error for the rest of the script
|
|
set -e
|
|
|
|
echo "Starting application..."
|
|
exec "$@"
|