- 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
2.4 KiB
2.4 KiB
🔧 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
3001to3002 - Changed PostgreSQL staging port from
5433to5434 - Changed Redis staging port from
6380to6381
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.ymlto detect branch and use correct compose file - Created dedicated
staging-deploy.ymlworkflow - 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)
git push origin dev
# → Uses docker-compose.staging.yml
# → Deploys to port 3002
# → Does NOT touch production containers
Production (production branch)
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
-
Test staging deployment:
git push origin dev # Should deploy to port 3002 without errors -
Verify staging:
curl http://localhost:3002/api/health -
When ready for production:
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. 🚀