File size: 719 Bytes
5dea10f 0d54045 5dea10f de800a4 0d54045 de800a4 5dea10f de800a4 0d54045 de800a4 78f1859 5dea10f | 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 | #!/bin/bash
# Sử dụng thư mục trong /app thay vì /root
export OLLAMA_MODELS=/app/.ollama/models
echo "Checking if Ollama is already running..."
if pgrep -x "ollama" > /dev/null; then
echo "Ollama is already running."
else
echo "Starting Ollama server..."
# Chạy Ollama với biến môi trường đúng
ollama serve &
# Đợi Ollama khởi động
echo "Waiting for Ollama to start..."
sleep 15
fi
# Kiểm tra lại xem Ollama đã chạy chưa
if ! pgrep -x "ollama" > /dev/null; then
echo "ERROR: Failed to start Ollama! Continuing anyway..."
fi
# Bắt đầu ứng dụng FastAPI
echo "Starting FastAPI application..."
uvicorn app:app --host 0.0.0.0 --port 7860 |