- Improvements working with the cloud, minio, graylog and some first bugfixing
This commit is contained in:
@@ -3,20 +3,23 @@
|
||||
cd "/app" || exit 1
|
||||
export PYTHONPATH="$PYTHONPATH:/app/"
|
||||
|
||||
# Ensure we can write the logs
|
||||
chown -R appuser:appuser /app/logs
|
||||
|
||||
# Wait for the database to be ready
|
||||
echo "Waiting for database to be ready"
|
||||
until pg_isready -h db -p 5432; do
|
||||
until pg_isready -h $DB_HOST -p $DB_PORT; do
|
||||
echo "Postgres is unavailable - sleeping"
|
||||
sleep 2
|
||||
done
|
||||
echo "Postgres is up - executing commands"
|
||||
|
||||
export PGPASSWORD=Skywalker!
|
||||
export PGPASSWORD=$DB_PASS
|
||||
# Check if the database exists and initialize if not
|
||||
if ! psql -U luke -h db -d eveai -c '\dt' | grep -q 'No relations found'; then
|
||||
if ! psql -U $DB_USER -h $DB_HOST -p $DB_PORT -d $DB_NAME -c '\dt' | grep -q 'No relations found'; then
|
||||
echo "Database eveai does not exist or is empty. Initializing..."
|
||||
psql -U luke -h db -d postgres -c "CREATE DATABASE eveai;"
|
||||
psql -U luke -h db -d eveai -c "CREATE EXTENSION IF NOT EXISTS vector;"
|
||||
psql -U $DB_USER -h $DB_HOST -p $DB_PORT -d postgres -c "CREATE DATABASE $DB_NAME;"
|
||||
psql -U $DB_USER -h $DB_HOST -p $DB_PORT -d $DB_NAME -c "CREATE EXTENSION IF NOT EXISTS vector;"
|
||||
fi
|
||||
|
||||
echo "Applying migrations to the public and tenant schema..."
|
||||
|
||||
Reference in New Issue
Block a user