diff --git a/code/websites/pokedex.online/DEPLOYMENT.md b/code/websites/pokedex.online/DEPLOYMENT.md index acb6c1b..99f505d 100644 --- a/code/websites/pokedex.online/DEPLOYMENT.md +++ b/code/websites/pokedex.online/DEPLOYMENT.md @@ -6,7 +6,69 @@ Pokedex.Online uses a multi-container Docker setup with: - **Frontend**: Nginx serving built Vue.js application - **Backend**: Node.js Express server (OAuth proxy + Gamemaster API) -## Quick Deploy +## Automated Deployment (Recommended) + +Use `deploy.sh` for a complete, automated deployment with built-in safety checks. + +### Basic Usage + +```bash +# Deploy to internal network +./deploy.sh --target internal + +# Deploy to external (requires Cloudflare tunnel) +./deploy.sh --target external --port 8080 --backend-port 3000 + +# Dry run (preview without deploying) +./deploy.sh --dry-run --target internal +``` + +### Options + +- `--target ` - Deployment target (default: internal) +- `--port ` - Frontend HTTP port (default: 8080) +- `--ssl-port ` - Frontend HTTPS port (optional) +- `--backend-port ` - Backend port (default: 3000) +- `--skip-tests` - Skip test execution +- `--skip-build` - Skip build step (use existing dist/) +- `--no-backup` - Skip backup creation +- `--dry-run` - Preview without deploying + +### What deploy.sh Does + +The deployment script automates the entire process: + +1. **Prerequisites Check** - Verifies Node.js, npm, and dependencies +2. **Environment Validation** - Checks for server/.env configuration +3. **Test Suite** - Runs frontend and backend tests +4. **Build Process** - Builds and verifies the application +5. **Backup Creation** - Creates timestamped backup (keeps last 5) +6. **Deployment** - Transfers files and starts containers +7. **Verification** - Health checks both services +8. **Summary** - Reports deployment URLs and next steps + +### Examples + +```bash +# Standard internal deployment +./deploy.sh --target internal + +# External deployment with custom ports +./deploy.sh --target external --port 8080 --ssl-port 8443 + +# Quick deploy (skip tests, use existing build) +./deploy.sh --skip-tests --skip-build + +# Development iteration (no backup needed) +./deploy.sh --no-backup --target internal + +# Check what would happen +./deploy.sh --dry-run +``` + +## Manual Deployment + +### Quick Deploy ```bash # Deploy to internal network (10.0.0.81) diff --git a/code/websites/pokedex.online/deploy.sh b/code/websites/pokedex.online/deploy.sh old mode 100644 new mode 100755