modern-django-starter/test-docker-build.sh
amitrana01 1567b84104 Fix Dokploy deployment issues with static files
- 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.
2025-09-11 17:47:15 +05:30

22 lines
748 B
Bash
Executable File

#!/bin/bash
echo "🔨 Testing Docker build with static file collection..."
# Build the production image
echo "Building production Docker image..."
docker build --target production -t django-template-test . || {
echo "❌ Docker build failed"
exit 1
}
echo "✅ Docker build completed successfully"
# Test if static files were collected during build
echo "🔍 Checking if static files were collected during build..."
docker run --rm django-template-test ls -la /app/staticfiles/ | head -10
echo "📁 Static files found in build:"
docker run --rm django-template-test find /app/staticfiles -name "*.css" -o -name "*.js" | head -5
echo "🧪 Build test completed. If you see static files above, the build-time collection is working!"