179 lines
4.3 KiB
Markdown
179 lines
4.3 KiB
Markdown
# VIP Coordinator - Simple Digital Ocean Deployment
|
|
|
|
This is a streamlined deployment script designed specifically for clean Digital Ocean Docker droplets.
|
|
|
|
## 🚀 Quick Start
|
|
|
|
1. **Upload the script** to your Digital Ocean droplet:
|
|
```bash
|
|
wget https://raw.githubusercontent.com/your-repo/vip-coordinator/main/simple-deploy.sh
|
|
chmod +x simple-deploy.sh
|
|
```
|
|
|
|
2. **Run the deployment**:
|
|
```bash
|
|
./simple-deploy.sh
|
|
```
|
|
|
|
3. **Follow the prompts** to configure:
|
|
- Your domain name (e.g., `mysite.com`)
|
|
- API subdomain (e.g., `api.mysite.com`)
|
|
- Email for SSL certificates
|
|
- Google OAuth credentials
|
|
- SSL certificate setup (optional)
|
|
|
|
## 📋 What It Does
|
|
|
|
### ✅ **Automatic Setup**
|
|
- Creates Docker Compose configuration using v2 syntax
|
|
- Generates secure random passwords
|
|
- Sets up environment variables
|
|
- Creates management scripts
|
|
|
|
### ✅ **SSL Certificate Automation** (Optional)
|
|
- Uses official certbot Docker container
|
|
- Webroot validation method
|
|
- Generates nginx SSL configuration
|
|
- Sets up automatic renewal script
|
|
|
|
### ✅ **Generated Files**
|
|
- `.env` - Environment configuration
|
|
- `docker-compose.yml` - Docker services
|
|
- `start.sh` - Start the application
|
|
- `stop.sh` - Stop the application
|
|
- `status.sh` - Check application status
|
|
- `nginx-ssl.conf` - SSL nginx configuration (if SSL enabled)
|
|
- `renew-ssl.sh` - Certificate renewal script (if SSL enabled)
|
|
|
|
## 🔧 Requirements
|
|
|
|
### **Digital Ocean Droplet**
|
|
- Ubuntu 20.04+ or similar
|
|
- Docker and Docker Compose v2 installed
|
|
- Ports 80, 443, and 3000 open
|
|
|
|
### **Domain Setup**
|
|
- Domain pointing to your droplet IP
|
|
- API subdomain pointing to your droplet IP
|
|
- DNS propagated (check with `nslookup yourdomain.com`)
|
|
|
|
### **Google OAuth**
|
|
- Google Cloud Console project
|
|
- OAuth 2.0 Client ID and Secret
|
|
- Redirect URI configured
|
|
|
|
## 🌐 Access URLs
|
|
|
|
After deployment:
|
|
- **Frontend**: `https://yourdomain.com` (or `http://` if no SSL)
|
|
- **Backend API**: `https://api.yourdomain.com` (or `http://` if no SSL)
|
|
|
|
## 🔒 SSL Certificate Setup
|
|
|
|
If you choose SSL during setup:
|
|
|
|
1. **Automatic Generation**: Uses Let's Encrypt with certbot Docker
|
|
2. **Nginx Configuration**: Generated automatically
|
|
3. **Manual Steps**:
|
|
```bash
|
|
# Install nginx
|
|
apt update && apt install nginx
|
|
|
|
# Copy SSL configuration
|
|
cp nginx-ssl.conf /etc/nginx/sites-available/vip-coordinator
|
|
ln -s /etc/nginx/sites-available/vip-coordinator /etc/nginx/sites-enabled/
|
|
rm /etc/nginx/sites-enabled/default
|
|
|
|
# Test and restart
|
|
nginx -t
|
|
systemctl restart nginx
|
|
```
|
|
|
|
4. **Auto-Renewal**: Set up cron job
|
|
```bash
|
|
echo "0 3 1 * * $(pwd)/renew-ssl.sh" | crontab -
|
|
```
|
|
|
|
## 🛠️ Management Commands
|
|
|
|
```bash
|
|
# Start the application
|
|
./start.sh
|
|
|
|
# Stop the application
|
|
./stop.sh
|
|
|
|
# Check status
|
|
./status.sh
|
|
|
|
# View logs
|
|
docker compose logs -f
|
|
|
|
# Update to latest version
|
|
docker compose pull
|
|
docker compose up -d
|
|
```
|
|
|
|
## 🔑 Important Credentials
|
|
|
|
The script generates and displays:
|
|
- **Admin Password**: For emergency access
|
|
- **Database Password**: For PostgreSQL
|
|
- **Keep these secure!**
|
|
|
|
## 🎯 First Time Login
|
|
|
|
1. Open your frontend URL
|
|
2. Click "Continue with Google"
|
|
3. The first user becomes the administrator
|
|
4. Use the admin password if needed
|
|
|
|
## 🐛 Troubleshooting
|
|
|
|
### **Port Conflicts**
|
|
- Uses standard ports (80, 443, 3000)
|
|
- Ensure no other services are running on these ports
|
|
|
|
### **SSL Issues**
|
|
- Verify domain DNS is pointing to your server
|
|
- Check firewall allows ports 80 and 443
|
|
- Ensure no other web server is running
|
|
|
|
### **Docker Issues**
|
|
```bash
|
|
# Check Docker version (should be v2)
|
|
docker compose version
|
|
|
|
# Check container status
|
|
docker compose ps
|
|
|
|
# View logs
|
|
docker compose logs backend
|
|
docker compose logs frontend
|
|
```
|
|
|
|
### **OAuth Issues**
|
|
- Verify redirect URI in Google Console matches exactly
|
|
- Check Client ID and Secret are correct
|
|
- Ensure domain is accessible from internet
|
|
|
|
## 📞 Support
|
|
|
|
If you encounter issues:
|
|
|
|
1. Check `./status.sh` for service health
|
|
2. Review logs with `docker compose logs`
|
|
3. Verify domain DNS resolution
|
|
4. Ensure all ports are accessible
|
|
|
|
## 🎉 Success!
|
|
|
|
Your VIP Coordinator should now be running with:
|
|
- ✅ Google OAuth authentication
|
|
- ✅ Mobile-friendly interface
|
|
- ✅ Real-time scheduling
|
|
- ✅ User management
|
|
- ✅ SSL encryption (if enabled)
|
|
- ✅ Automatic updates from Docker Hub
|
|
|
|
Perfect for Digital Ocean droplet deployments! |