- Changed staging app port from 3001 to 3002 in docker-compose.staging.yml - Updated PostgreSQL port from 5433 to 5434 and Redis port from 6380 to 6381 - Modified STAGING_SETUP.md to reflect new port configurations - Adjusted CI/CD workflows to accommodate new staging ports and improve deployment messages - Added N8N environment variables to staging configuration for better integration
90 lines
2.4 KiB
Markdown
90 lines
2.4 KiB
Markdown
# 🔧 Deployment Fixes Applied
|
|
|
|
## Issues Fixed
|
|
|
|
### 1. Port 3001 Already Allocated ❌ → ✅
|
|
**Problem**: Port 3001 was already in use, causing staging deployment to fail.
|
|
|
|
**Fix**:
|
|
- Changed staging port from `3001` to `3002`
|
|
- Changed PostgreSQL staging port from `5433` to `5434`
|
|
- Changed Redis staging port from `6380` to `6381`
|
|
|
|
### 2. Docker Compose Version Warning ❌ → ✅
|
|
**Problem**: `version: '3.8'` is obsolete in newer Docker Compose.
|
|
|
|
**Fix**: Removed `version` line from `docker-compose.staging.yml`
|
|
|
|
### 3. Missing N8N Environment Variables ❌ → ✅
|
|
**Problem**: `N8N_SECRET_TOKEN` warning appeared.
|
|
|
|
**Fix**: Added `N8N_WEBHOOK_URL` and `N8N_SECRET_TOKEN` to staging compose file
|
|
|
|
### 4. Wrong Compose File Used ❌ → ✅
|
|
**Problem**: Gitea workflow was using wrong compose file (stopping production containers).
|
|
|
|
**Fix**:
|
|
- Updated `ci-cd-with-gitea-vars.yml` to detect branch and use correct compose file
|
|
- Created dedicated `staging-deploy.yml` workflow
|
|
- Staging now uses `docker-compose.staging.yml`
|
|
- Production uses `docker-compose.production.yml`
|
|
|
|
## Updated Ports
|
|
|
|
| Service | Staging | Production |
|
|
|---------|---------|------------|
|
|
| App | **3002** ✅ | **3000** |
|
|
| PostgreSQL | **5434** ✅ | **5432** |
|
|
| Redis | **6381** ✅ | **6379** |
|
|
|
|
## How It Works Now
|
|
|
|
### Staging (dev/main branch)
|
|
```bash
|
|
git push origin dev
|
|
# → Uses docker-compose.staging.yml
|
|
# → Deploys to port 3002
|
|
# → Does NOT touch production containers
|
|
```
|
|
|
|
### Production (production branch)
|
|
```bash
|
|
git push origin production
|
|
# → Uses docker-compose.production.yml
|
|
# → Deploys to port 3000
|
|
# → Zero-downtime deployment
|
|
# → Does NOT touch staging containers
|
|
```
|
|
|
|
## Files Updated
|
|
|
|
- ✅ `docker-compose.staging.yml` - Fixed ports, removed version, added N8N vars
|
|
- ✅ `.gitea/workflows/ci-cd-with-gitea-vars.yml` - Branch detection, correct compose files
|
|
- ✅ `.gitea/workflows/staging-deploy.yml` - New dedicated staging workflow
|
|
- ✅ `STAGING_SETUP.md` - Updated port references
|
|
|
|
## Next Steps
|
|
|
|
1. **Test staging deployment**:
|
|
```bash
|
|
git push origin dev
|
|
# Should deploy to port 3002 without errors
|
|
```
|
|
|
|
2. **Verify staging**:
|
|
```bash
|
|
curl http://localhost:3002/api/health
|
|
```
|
|
|
|
3. **When ready for production**:
|
|
```bash
|
|
git checkout production
|
|
git merge main
|
|
git push origin production
|
|
# Deploys safely to port 3000
|
|
```
|
|
|
|
---
|
|
|
|
**All fixes applied!** Staging and production are now completely isolated. 🚀
|