-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart.sh
More file actions
45 lines (38 loc) Β· 1.2 KB
/
start.sh
File metadata and controls
45 lines (38 loc) Β· 1.2 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# DermaLens Backend Startup Script
echo "π§΄ Starting DermaLens Backend..."
# Check if .env exists
if [ ! -f .env ]; then
echo "β οΈ .env file not found!"
echo "Creating .env from .env.example..."
cp .env.example .env
echo "β
.env file created. Please update it with your credentials."
exit 1
fi
# Activate virtual environment if it exists
if [ -d "venv" ]; then
echo "π¦ Activating virtual environment..."
source venv/bin/activate
else
echo "β οΈ Virtual environment not found!"
echo "Creating virtual environment..."
python3 -m venv venv
source venv/bin/activate
echo "Installing dependencies..."
pip install -r requirements.txt
fi
# Check if database is accessible
echo "π Checking database connection..."
python -c "
from app.core.config import settings
print(f'Database URL: {settings.DATABASE_URL}')
" || exit 1
# Run migrations
echo "π Running database migrations..."
alembic upgrade head
# Start the server
echo "π Starting FastAPI server..."
echo "π API will be available at: http://localhost:8000"
echo "π API Documentation: http://localhost:8000/api/v1/docs"
echo ""
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000