- DigitalOcean account (sign up here)
- GitHub repository with your code
- Credit card for billing (starts at $5/month)
-
Ensure your code is pushed to GitHub:
git add . git commit -m "Ready for DigitalOcean deployment" git push origin main
-
Update the app spec file:
- Edit
.do/app.yaml - Replace
YOUR_GITHUB_USERNAMEwith your actual GitHub username
- Edit
-
Go to DigitalOcean App Platform:
- Visit cloud.digitalocean.com/apps
- Click "Create App"
-
Connect GitHub:
- Click "GitHub" tab
- Authorize DigitalOcean to access your repositories
- Select your
Live-Measurements-Apirepository - Choose the
mainbranch
-
Configure the App:
- Name:
ai-body-measurements(or your preferred name) - Region: Choose closest to your users
- Plan: Basic ($5/month) - sufficient for testing
- Name:
-
App Settings:
- Source Directory:
/(root) - Build Command:
pip install -r requirements-deploy.txt - Run Command:
gunicorn --bind 0.0.0.0:$PORT app:app - Environment: Python 3.11
- Source Directory:
Add these environment variables in the DigitalOcean dashboard:
PORT:8000FLASK_ENV:production
-
Review Configuration:
- Check all settings
- Verify the GitHub repository is correct
- Ensure the build and run commands are set
-
Create Resources:
- Click "Create Resources"
- Wait for deployment to complete (5-10 minutes)
-
Monitor Deployment:
- Watch the build logs for any errors
- Check the "Live App" tab for your running application
Once deployed, you'll get a URL like:
https://ai-body-measurements-xxxxx.ondigitalocean.app
- Open the URL in your browser
- Upload test images using the web interface
- Verify measurements are calculated correctly
-
Build Failures:
- Check the build logs in DigitalOcean dashboard
- Ensure all dependencies are in
requirements-deploy.txt - Verify Python version compatibility
-
App Won't Start:
- Check the run command is correct
- Verify the PORT environment variable
- Look at the runtime logs
-
Memory Issues:
- Upgrade to a larger instance size
- Consider optimizing the AI models
-
Upgrade Instance Size:
- Basic XS: $12/month (1GB RAM)
- Basic S: $24/month (2GB RAM)
- Recommended for production: Basic M ($48/month, 4GB RAM)
-
Enable CDN:
- Add a CDN for faster image loading
- Configure caching for static assets
- Basic XXS: $5/month (512MB RAM) - Good for testing
- Basic XS: $12/month (1GB RAM) - Recommended minimum
- Basic S: $24/month (2GB RAM) - Better performance
- Basic M: $48/month (4GB RAM) - Production ready
- Domain Setup: Configure a custom domain
- SSL Certificate: Automatic HTTPS with DigitalOcean
- Monitoring: Set up alerts and monitoring
- Scaling: Configure auto-scaling for high traffic
- DigitalOcean Documentation: docs.digitalocean.com
- Community Forum: digitalocean.com/community
- Support Tickets: Available in your DigitalOcean dashboard