26 lines
533 B
Bash
26 lines
533 B
Bash
#!/bin/bash
|
|
|
|
set -e # exit if any command fails
|
|
|
|
# Ensure src/database directory exists
|
|
mkdir -p src/database
|
|
|
|
# Create virtual environment if it doesn't exist
|
|
if [ ! -d "venv" ]; then
|
|
python -m venv venv
|
|
fi
|
|
source venv/bin/activate
|
|
|
|
# Upgrade pip and install dependencies
|
|
pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
# Export environment variables
|
|
export FLASK_APP=src.app
|
|
export FLASK_ENV=production
|
|
|
|
# Run with Gunicorn
|
|
echo "Starting Flask app with Gunicorn..."
|
|
exec gunicorn -w 4 -b 0.0.0.0:8000 src.app:app
|
|
|