🚀 Add automated deployment script with detailed options and instructions in documentation

This commit is contained in:
2026-01-29 13:56:49 +00:00
parent 868e506ad8
commit c595623893
2 changed files with 63 additions and 1 deletions

View File

@@ -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 <internal|external>` - Deployment target (default: internal)
- `--port <number>` - Frontend HTTP port (default: 8080)
- `--ssl-port <number>` - Frontend HTTPS port (optional)
- `--backend-port <number>` - 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)