-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·43 lines (34 loc) · 1.2 KB
/
start.sh
File metadata and controls
executable file
·43 lines (34 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
#!/bin/bash
# Development startup script
# Activate virtual environment if it exists
if [ -d ".venv" ]; then
source .venv/bin/activate
echo "Activated virtual environment"
fi
# Load environment variables from .env file if it exists
if [ -f ".env" ]; then
export $(cat .env | grep -v '^#' | xargs)
echo "Loaded environment variables from .env file"
else
echo "Warning: .env file not found. Copy .env.example to .env and configure your API keys."
fi
# Set default environment variables
export BACKEND_IMAGE="${BACKEND_IMAGE:-stock-analyst:latest}"
export DATA_VOLUME="${DATA_VOLUME:-stockdata}"
echo "Starting API Runner with:"
echo " Backend Image: $BACKEND_IMAGE"
echo " Data Volume: $DATA_VOLUME"
echo " Port: 8080"
echo " SERPAPI_API_KEY: ${SERPAPI_API_KEY:+configured}"
echo " OPENAI_API_KEY: ${OPENAI_API_KEY:+configured}"
# Check if API keys are set
if [ -z "$SERPAPI_API_KEY" ]; then
echo "Warning: SERPAPI_API_KEY is not set"
fi
if [ -z "$OPENAI_API_KEY" ]; then
echo "Warning: OPENAI_API_KEY is not set"
fi
# Create Docker volume if it doesn't exist
docker volume create $DATA_VOLUME 2>/dev/null || true
# Start the application
uvicorn main:app --reload --host 0.0.0.0 --port 8080