File size: 523 Bytes
63f90ce
 
 
6712559
 
 
63f90ce
 
 
 
 
 
 
 
 
 
 
6712559
63f90ce
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -e

# Ensure proper Python path
export PYTHONPATH=/app:${PYTHONPATH}

# Wait for database to be ready (if using PostgreSQL)
if [ "$DATABASE_URL" != "${DATABASE_URL#postgresql://}" ]; then
    echo "Waiting for PostgreSQL to be ready..."
    while ! nc -z db 5432; do
        sleep 0.1
    done
    echo "PostgreSQL is ready"
fi

# Run database migrations
echo "Running database migrations..."
cd /app && alembic upgrade head

# Start the application
echo "Starting the application..."
exec python -m app.main