- Add CompositionImage model with multi-image upload and main image flag - Add composition endpoints: add-images, set-main-image, delete image, by-created-at filter - Make contact-us by_category public - Add 24 API tests covering all endpoints - Add Dockerfile, docker-compose, entrypoint and docker docs - Add Persian API docs and update README and Postman collection Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
825 B
Bash
27 lines
825 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Waiting for PostgreSQL to be ready..."
|
|
while ! pg_isready -h db -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-Zoneco_ORG}; do
|
|
echo "PostgreSQL is unavailable - sleeping"
|
|
sleep 1
|
|
done
|
|
|
|
echo "PostgreSQL is up - executing command"
|
|
|
|
# Collect static files
|
|
echo "Collecting static files..."
|
|
python manage.py collectstatic --noinput
|
|
|
|
# Run migrations
|
|
echo "Running migrations..."
|
|
python manage.py migrate --noinput
|
|
|
|
# Create superuser if it doesn't exist (optional, can be removed in production)
|
|
# Uncomment and modify if needed:
|
|
# echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.filter(username='admin').exists() or User.objects.create_superuser('admin', 'admin@example.com', 'admin')" | python manage.py shell
|
|
|
|
echo "Starting application..."
|
|
exec "$@"
|
|
|