File size: 805 Bytes
f08f6c6
 
bed415e
 
892ed24
bed415e
 
 
fe51676
bed415e
 
892ed24
bed415e
 
f08f6c6
bed415e
 
 
 
f08f6c6
 
 
bed415e
f08f6c6
bed415e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

# Exit on error
set -e

# Get the absolute path of the script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"

# Add project root and app directory to Python path
export PYTHONPATH="${PROJECT_ROOT}:${PROJECT_ROOT}/app:${PYTHONPATH:-}"

# Create storage directory if it doesn't exist
mkdir -p "${PROJECT_ROOT}/app/storage"

# Print current working directory and Python path for debugging
echo "Current directory: $(pwd)"
echo "PYTHONPATH: ${PYTHONPATH}"
echo "Project root: ${PROJECT_ROOT}"

# Run database migrations
echo "Running database migrations..."
python "${SCRIPT_DIR}/migrate.py"

# Start the FastAPI application with uvicorn
echo "Starting FastAPI application..."
uvicorn app.main:app --host 0.0.0.0 --port 7860 --reload