-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlify_start.sh
More file actions
executable file
·44 lines (34 loc) · 961 Bytes
/
netlify_start.sh
File metadata and controls
executable file
·44 lines (34 loc) · 961 Bytes
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
#!/bin/bash
# Set Python version
export PYTHON_VERSION=3.9
# Check for available Python versions
echo "Available Python versions:"
which python python3 python3.9 python3.11 2>/dev/null | sort
# Try to use Python 3.9 if available
if command -v python3.9 &> /dev/null; then
PYTHON_CMD=python3.9
elif command -v python3 &> /dev/null; then
PYTHON_CMD=python3
else
PYTHON_CMD=python
fi
echo "Using Python: $($PYTHON_CMD --version)"
# Create and activate virtual environment
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
$PYTHON_CMD -m venv venv
fi
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
# Upgrade pip
python -m pip install --upgrade pip
# Install dependencies
echo "Installing dependencies..."
pip install -r requirements.txt
# Verify installations
echo "Verifying installations..."
pip list
# Start the application
echo "Starting application..."
python app.py