Initial commit: OpenClaw workspace with habit bot and flashcard app
This commit is contained in:
55
deploy_rag.sh
Executable file
55
deploy_rag.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
# RAG Flask App - Deployment Setup for Ubuntu
|
||||
# Run on 192.168.0.147
|
||||
|
||||
set -e
|
||||
|
||||
APP_DIR="/home/joungmin/rag"
|
||||
VENV_DIR="$APP_DIR/venv"
|
||||
|
||||
echo "🔮 Setting up Oracle RAG Flask App..."
|
||||
|
||||
# Create directory if needed
|
||||
mkdir -p $APP_DIR
|
||||
|
||||
# Create virtual environment
|
||||
if [ ! -d "$VENV_DIR" ]; then
|
||||
python3 -m venv $VENV_DIR
|
||||
fi
|
||||
|
||||
# Install dependencies
|
||||
source $VENV_DIR/bin/activate
|
||||
pip install -q flask gunicorn
|
||||
|
||||
# Create systemd service file
|
||||
cat > /tmp/rag-flask.service << 'EOF'
|
||||
[Unit]
|
||||
Description=Oracle RAG Flask App
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=joungmin
|
||||
WorkingDirectory=/home/joungmin/rag
|
||||
Environment="PATH=/home/joungmin/rag/venv/bin"
|
||||
Environment="PORT=8000"
|
||||
ExecStart=/home/joungmin/rag/venv/bin/gunicorn -w 4 -b 0.0.0.0:8000 app:app
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
echo "✅ Setup complete!"
|
||||
echo ""
|
||||
echo "To start the service:"
|
||||
echo " sudo cp /tmp/rag-flask.service /etc/systemd/system/"
|
||||
echo " sudo systemctl daemon-reload"
|
||||
echo " sudo systemctl start rag-flask"
|
||||
echo " sudo systemctl enable rag-flask"
|
||||
echo ""
|
||||
echo "Or run manually:"
|
||||
echo " source $VENV_DIR/bin/activate"
|
||||
echo " gunicorn -w 4 -b 0.0.0.0:8000 app:app"
|
||||
echo ""
|
||||
echo "Access at: http://192.168.0.147:8000"
|
||||
Reference in New Issue
Block a user