Spaces:
Configuration error
Configuration error
| # OpenPoke Deployment Script | |
| echo "π Deploying OpenPoke with FriendliAI integration..." | |
| # Check if .env file exists | |
| if [ ! -f ".env" ]; then | |
| echo "β οΈ Warning: .env file not found!" | |
| echo "π Please copy .env.example to .env and configure your API keys:" | |
| echo " cp .env.example .env" | |
| echo " # Then edit .env with your actual credentials" | |
| echo "" | |
| echo "π Continuing with default configuration (you may need to configure API keys manually)..." | |
| fi | |
| # Check if Docker is installed | |
| if ! command -v docker &> /dev/null; then | |
| echo "β Docker is not installed. Please install Docker first." | |
| exit 1 | |
| fi | |
| # Check if docker-compose is installed | |
| if command -v docker-compose &> /dev/null; then | |
| COMPOSE_CMD="docker-compose" | |
| elif docker compose version &> /dev/null; then | |
| COMPOSE_CMD="docker compose" | |
| else | |
| echo "β docker-compose is not installed. Please install docker-compose (or enable the Docker Compose plugin) first." | |
| exit 1 | |
| fi | |
| # Stop any existing containers | |
| echo "π Stopping existing containers..." | |
| ${COMPOSE_CMD} down | |
| # Build and start the services | |
| echo "π¨ Building and starting services..." | |
| if [ -f ".env" ]; then | |
| ${COMPOSE_CMD} --env-file .env up --build -d | |
| else | |
| ${COMPOSE_CMD} up --build -d | |
| fi | |
| # Wait for services to be ready | |
| echo "β³ Waiting for services to start..." | |
| sleep 15 | |
| # Check if services are running | |
| if ${COMPOSE_CMD} ps | grep -q "Up"; then | |
| echo "β Deployment successful!" | |
| echo "" | |
| echo "π Services are running:" | |
| echo " - Server API: http://localhost:8001" | |
| echo " - Web UI: http://localhost:3000" | |
| echo "" | |
| echo "π Check the logs with: ${COMPOSE_CMD} logs -f" | |
| echo "π View service status: ${COMPOSE_CMD} ps" | |
| echo "π Stop with: ${COMPOSE_CMD} down" | |
| echo "" | |
| echo "π‘ Tip: If you encounter API key issues, edit your .env file with correct credentials" | |
| else | |
| echo "β Deployment failed. Check the logs with: ${COMPOSE_CMD} logs" | |
| echo "" | |
| echo "π§ Troubleshooting tips:" | |
| echo " 1. Check if your .env file has valid API keys" | |
| echo " 2. Verify Docker has enough resources" | |
| echo " 3. Check firewall settings" | |
| exit 1 | |
| fi |