Files

26 lines
695 B
Bash
Raw Permalink Normal View History

2025-12-29 03:06:49 +08:00
#!/bin/bash
# QuantDinger Python API startup script
2025-12-29 03:06:49 +08:00
# Activate the virtual environment if one is used
2025-12-29 03:06:49 +08:00
# source venv/bin/activate
# Check whether dependencies are installed
2025-12-29 03:06:49 +08:00
if ! python -c "import flask" 2>/dev/null; then
echo "Installing dependencies..."
2025-12-29 03:06:49 +08:00
pip install -r requirements.txt
fi
# Start the service
echo "Starting QuantDinger Python API service..."
echo "Service address: http://0.0.0.0:5000"
2025-12-29 03:06:49 +08:00
# Create the log directory
2025-12-29 03:06:49 +08:00
mkdir -p logs
# Development environment (uses the new entry file)
2025-12-29 03:06:49 +08:00
python run.py
# Production environment (uses gunicorn)
2025-12-29 03:06:49 +08:00
# gunicorn -w 4 -b 0.0.0.0:5000 --timeout 120 --access-logfile logs/access.log --error-logfile logs/error.log "run:create_app()"