- Add STATIC_ROOT and MEDIA_ROOT settings with environment variable support - Update settings.py to use environment variables for SECRET_KEY, DEBUG, ALLOWED_HOSTS, TIME_ZONE - Improve docker-entrypoint.sh to auto-create static/media directories - Always run collectstatic in Docker (not just production) - Add check_settings.py script for configuration verification - Add PRODUCTION_CHECKLIST.md for deployment guide - Update .env.example with all configuration options - Update .gitignore for proper static/media file handling This fixes the ImproperlyConfigured error when deploying with Docker. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
640 B
Bash
Executable File
31 lines
640 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Starting Django application..."
|
|
echo "Environment: ${DJANGO_ENV:-development}"
|
|
echo ""
|
|
|
|
# 정적/미디어 파일 디렉토리 생성
|
|
echo "Creating directories..."
|
|
mkdir -p /app/staticfiles
|
|
mkdir -p /app/mediafiles
|
|
|
|
# 데이터베이스 마이그레이션
|
|
echo "Running database migrations..."
|
|
python manage.py migrate --noinput
|
|
|
|
# 전략 초기화
|
|
echo "Initializing strategies..."
|
|
python manage.py init_strategies
|
|
|
|
# 정적 파일 수집
|
|
echo "Collecting static files..."
|
|
python manage.py collectstatic --noinput --clear
|
|
|
|
echo ""
|
|
echo "Django application ready!"
|
|
echo ""
|
|
|
|
# 전달된 명령어 실행
|
|
exec "$@"
|