Spaces:
Build error
Build error
Quick Start - Deploy to Hugging Face in 5 Minutes
Prerequisites
- Hugging Face account
- NVIDIA API key
- MySQL database URL
Step 1: Create Hugging Face Space
# Go to https://huggingface.co/spaces
# Click "Create new Space"
# Select "Docker" as SDK
# Name it: domify-academy-bot
Step 2: Get Your Repository URL
After creating the Space, you'll see:
https://huggingface.co/spaces/YOUR_USERNAME/domify-academy-bot
Step 3: Push Code
cd /path/to/domify-academy-bot
# Initialize git (if not already done)
git init
# Add all files
git add .
# Commit
git commit -m "Initial commit"
# Add Hugging Face remote
git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/domify-academy-bot
# Push to Hugging Face
git push -u origin main
Step 4: Set Environment Variables
In Hugging Face Space settings:
- Go to Settings β Repository secrets
- Add these variables:
| Key | Value |
|---|---|
DATABASE_URL |
mysql://user:pass@host/db |
NVIDIA_API_KEY |
Your NVIDIA API key |
JWT_SECRET |
openssl rand -base64 32 |
Step 5: Wait for Build
Hugging Face automatically:
- Detects
Dockerfile - Builds the image
- Deploys the container
- Assigns a public URL
Check status in the "Build" tab
Step 6: Test
Once deployed:
# Test health endpoint
curl https://YOUR_SPACE_URL/api/health
# Should return:
# {"status":"healthy","uptime":123.45,...}
Done! π
Your backend is now live on Hugging Face Spaces!
Troubleshooting
Build fails
Check logs:
- Go to "Build" tab
- Look for error messages
- Common issues:
- Missing environment variables
- Database connection error
- Invalid NVIDIA API key
Application crashes
Check logs:
- Go to "Logs" tab
- Look for error messages
- Restart the Space if needed
Slow responses
Possible causes:
- Database too slow
- NVIDIA API busy
- Rate limiting triggered
Next Steps
- Build the frontend
- Deploy to same Space or separate URL
- Configure custom domain
- Set up monitoring and alerts
Support
- Deployment issues: See
DEPLOYMENT.md - Backend details: See
BACKEND_README.md - Architecture: See
ARCHITECTURE.md