- Create App Platform deployment spec (.do/app.yaml) - Add comprehensive APP_PLATFORM_DEPLOYMENT.md guide - Configure Docker Hub as container registry - Set up managed PostgreSQL database - Configure auto-SSL and custom domain support - Total cost: ~$17/month (vs $24+ for droplets) Images available on Docker Hub: - t72chevy/vip-coordinator-backend:latest - t72chevy/vip-coordinator-frontend:latest Images also available on Gitea: - gitea.madeamess.online/kyle/vip-coordinator/backend:latest - gitea.madeamess.online/kyle/vip-coordinator/frontend:latest Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
8.5 KiB
VIP Coordinator - Digital Ocean App Platform Deployment
Overview
Deploy VIP Coordinator using Digital Ocean App Platform for a fully managed, cheaper deployment ($17/month total vs $24+ for droplets).
What You Get
- ✅ Automatic SSL/HTTPS (Let's Encrypt)
- ✅ Auto-scaling (if needed)
- ✅ Managed PostgreSQL database
- ✅ No server management
- ✅ Automatic deployments from Docker Hub
- ✅ Built-in monitoring
Cost Breakdown
| Service | Size | Cost/Month |
|---|---|---|
| Backend | basic-xxs | $5 |
| Frontend | basic-xxs | $5 |
| PostgreSQL | Dev tier | $7 |
| Total | $17/month |
Prerequisites
✅ Docker images pushed to Docker Hub:
t72chevy/vip-coordinator-backend:latestt72chevy/vip-coordinator-frontend:latest
Deployment Steps
Step 1: Make Docker Hub Repos Private (Optional but Recommended)
- Go to Docker Hub
- Click
vip-coordinator-backend→ Settings → Make Private - Click
vip-coordinator-frontend→ Settings → Make Private
Step 2: Create App on Digital Ocean
- Go to Digital Ocean App Platform
- Click Create App
- Choose Docker Hub as source
Step 3: Configure Docker Hub Authentication
- Registry: Docker Hub
- Username:
t72chevy - Access Token:
dckr_pat_CPwzonJV_nCTIa05Ib_w8NFRrpQ - Click Next
Step 4: Add Backend Service
- Click + Add Resource → Service
- Source:
- Registry: Docker Hub
- Repository:
t72chevy/vip-coordinator-backend - Tag:
latest
- HTTP Port:
3000 - HTTP Request Routes:
/api - Health Check:
- Path:
/api/v1/health - Initial delay: 40 seconds
- Path:
- Instance Size: Basic (XXS) - $5/month
- Environment Variables: (Add these)
NODE_ENV=production AUTH0_DOMAIN=dev-s855cy3bvjjbkljt.us.auth0.com AUTH0_AUDIENCE=https://vip-coordinator-api AUTH0_ISSUER=https://dev-s855cy3bvjjbkljt.us.auth0.com/ - Click Save
Step 5: Add Frontend Service
- Click + Add Resource → Service
- Source:
- Registry: Docker Hub
- Repository:
t72chevy/vip-coordinator-frontend - Tag:
latest
- HTTP Port:
80 - HTTP Request Routes:
/ - Instance Size: Basic (XXS) - $5/month
- Click Save
Step 6: Add PostgreSQL Database
- Click + Add Resource → Database
- Engine: PostgreSQL 16
- Name:
vip-db - Plan: Dev ($7/month) or Production ($15/month)
- This automatically creates
${vip-db.DATABASE_URL}variable - Click Save
Step 7: Add Redis (Optional - for sessions)
Option A: Use App Platform Redis (Recommended)
- Wait - App Platform doesn't have managed Redis yet
- Skip for now, or use Upstash Redis (free tier)
Option B: Skip Redis
- Backend will work without Redis
- Remove Redis-dependent features temporarily
Step 8: Configure Environment Variables
Go back to backend service and add:
# Database (automatically set by App Platform)
DATABASE_URL=${vip-db.DATABASE_URL}
# Auth0
AUTH0_DOMAIN=dev-s855cy3bvjjbkljt.us.auth0.com
AUTH0_AUDIENCE=https://vip-coordinator-api
AUTH0_ISSUER=https://dev-s855cy3bvjjbkljt.us.auth0.com/
# Application
NODE_ENV=production
PORT=3000
# Redis (if using Upstash or external)
REDIS_URL=redis://your-redis-url:6379
Step 9: Configure Custom Domain
- In App settings, go to Settings → Domains
- Click Add Domain
- Enter:
vip.madeamess.online - You'll get DNS instructions:
Type: CNAME Name: vip Value: <app-name>.ondigitalocean.app
Step 10: Update Namecheap DNS
- Go to Namecheap Dashboard
- Select
madeamess.online→ Advanced DNS - Add CNAME record:
Type: CNAME Record Host: vip Value: <your-app>.ondigitalocean.app TTL: Automatic - Save
Step 11: Update Auth0 Callbacks
- Go to Auth0 Dashboard
- Select your VIP Coordinator application
- Update URLs:
Allowed Callback URLs: https://vip.madeamess.online Allowed Web Origins: https://vip.madeamess.online Allowed Logout URLs: https://vip.madeamess.online - Click Save Changes
Step 12: Deploy!
- Review all settings
- Click Create Resources
- Wait 5-10 minutes for deployment
- App Platform will:
- Pull Docker images
- Create database
- Run migrations (via entrypoint script)
- Configure SSL
- Deploy to production
Verification
Check Deployment Status
- Go to App Platform dashboard
- Check all services are Deployed (green)
- Click on app URL to test
Test Endpoints
# Health check
curl https://vip.madeamess.online/api/v1/health
# Frontend
curl https://vip.madeamess.online/
Test Login
- Go to
https://vip.madeamess.online - Click login
- Authenticate with Auth0
- First user should be auto-approved as admin
Updating Application
When you push new images to Docker Hub:
- Go to App Platform dashboard
- Click your app → Settings → Component (backend or frontend)
- Click Force Rebuild and Redeploy
Or set up Auto-Deploy:
- Go to component settings
- Enable Autodeploy
- New pushes to Docker Hub will auto-deploy
Monitoring & Logs
View Logs
- App Platform dashboard → Your app
- Click Runtime Logs
- Select service (backend/frontend)
- View real-time logs
View Metrics
- Click Insights
- See CPU, memory, requests
- Set up alerts
Database Management
Connect to Database
# Get connection string from App Platform dashboard
# Environment → DATABASE_URL
# Connect via psql
psql "postgresql://doadmin:<password>@<host>:25060/defaultdb?sslmode=require"
Backups
- Dev tier: Daily backups (7 days retention)
- Production tier: Daily backups (14 days retention)
- Manual backups available
Run Migrations
Migrations run automatically on container startup via docker-entrypoint.sh.
To manually trigger:
- Go to backend component
- Click Console
- Run:
npx prisma migrate deploy
Troubleshooting
App Won't Start
- Check Runtime Logs for errors
- Verify environment variables are set
- Check database connection string
- Ensure images are accessible (public or authenticated)
Database Connection Failed
- Verify
DATABASE_URLis set correctly - Check database is running (green status)
- Ensure migrations completed successfully
Frontend Shows 502
- Check backend is healthy (
/api/v1/health) - Verify backend routes are configured correctly
- Check nginx logs in frontend component
Auth0 Login Fails
- Verify callback URLs match exactly
- Check
vip.madeamess.onlineis set correctly - Ensure HTTPS (not HTTP)
- Clear browser cache/cookies
Cost Optimization
Downsize if Needed
Basic XXS ($5/month):
- 512MB RAM, 0.5 vCPU
- Good for low traffic
Basic XS ($12/month):
- 1GB RAM, 1 vCPU
- Better for production
Use Dev Database
Dev Database ($7/month):
- 1GB RAM, 10GB storage
- 7 daily backups
- Good for testing
Production Database ($15/month):
- 2GB RAM, 25GB storage
- 14 daily backups
- Better performance
Optimize Images
Current sizes:
- Backend: 446MB → Can optimize to ~200MB
- Frontend: 75MB → Already optimized
Alternative: Deploy via CLI
# Install doctl
brew install doctl # Mac
# or download from https://docs.digitalocean.com/reference/doctl/
# Authenticate
doctl auth init
# Create app from spec
doctl apps create --spec .do/app.yaml
# Update app
doctl apps update <app-id> --spec .do/app.yaml
Redis Alternative (Free)
Since App Platform doesn't have managed Redis, use Upstash (free tier):
- Go to Upstash
- Create free Redis database
- Copy connection URL
- Add to backend environment:
REDIS_URL=rediss://default:<password>@<host>:6379
Or skip Redis entirely:
- Comment out Redis code in backend
- Remove session storage dependency
Support Resources
Deployment Complete! 🚀
Your VIP Coordinator will be live at: https://vip.madeamess.online
Total cost: ~$17/month (much cheaper than droplets!)