30 lines
672 B
Bash
30 lines
672 B
Bash
# Clone the repository
|
|
git clone https://git.maxprint.io/MaxApex/ticket_ai_flask_app.git /opt/ticket-ai
|
|
|
|
# navigate to the repo
|
|
cd /opt/ticket-ai
|
|
|
|
# Create virtual environment
|
|
python3 -m venv /opt/ticket-ai/venv
|
|
|
|
# Activate virtual environment and install Flask and flask_jwt_extended
|
|
source /opt/ticket-ai/venv/bin/activate
|
|
pip install Flask
|
|
pip install flask_jwt_extended
|
|
|
|
# Create systemd service file
|
|
cat <<EOF > /etc/systemd/system/ticket-ai.service
|
|
[Unit]
|
|
Description=Ticket AI
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/opt/ticket-ai/venv/bin/python3 /opt/ticket-ai/src/app.py
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
|
|
# Start the service
|
|
systemctl start ticket-ai.service
|