mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
17 lines
401 B
Bash
17 lines
401 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# Wait for PostgreSQL to be ready
|
|
echo "Waiting for PostgreSQL..."
|
|
until pg_isready -h db -p 5432 -U postgres; do
|
|
echo "PostgreSQL not ready, waiting..."
|
|
sleep 2
|
|
done
|
|
|
|
# Run Alembic migrations
|
|
echo "Running Alembic migrations..."
|
|
python3 -m alembic upgrade head
|
|
|
|
# Start Sanic service
|
|
echo "Starting Sanic service..."
|
|
exec python3 -OO /opt/wrolpi/main.py -v api --host 0.0.0.0
|