Update staging configuration to avoid port conflicts and enhance deployment scripts

- 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
This commit is contained in:
2026-01-09 12:41:41 +01:00
parent de0f3f1e66
commit db0bf2b0c6
6 changed files with 357 additions and 69 deletions

View File

@@ -5,11 +5,11 @@
You now have **two separate Docker stacks**:
1. **Staging** - Deploys automatically on `dev` or `main` branch
- Port: `3001`
- Port: `3002`
- Container: `portfolio-app-staging`
- Database: `portfolio_staging_db` (port 5433)
- Redis: `portfolio-redis-staging` (port 6380)
- URL: `https://staging.dk0.dev` (or `http://localhost:3001`)
- URL: `https://staging.dk0.dev` (or `http://localhost:3002`)
2. **Production** - Deploys automatically on `production` branch
- Port: `3000`
@@ -25,7 +25,7 @@ When you push to `dev` or `main` branch:
1. ✅ Tests run
2. ✅ Docker image is built and tagged as `staging`
3. ✅ Staging stack deploys automatically
4. ✅ Available on port 3001
4. ✅ Available on port 3002
### Automatic Production Deployment
When you merge to `production` branch:
@@ -55,9 +55,9 @@ When you merge to `production` branch:
| Service | Staging | Production |
|---------|---------|------------|
| App | 3001 | 3000 |
| PostgreSQL | 5433 | 5432 |
| Redis | 6380 | 6379 |
| App | 3002 | 3000 |
| PostgreSQL | 5434 | 5432 |
| Redis | 6381 | 6379 |
## Workflow
@@ -69,10 +69,10 @@ git checkout dev
# 2. Push to dev (triggers staging deployment)
git push origin dev
# → Staging deploys automatically on port 3001
# → Staging deploys automatically on port 3002
# 3. Test staging
curl http://localhost:3001/api/health
curl http://localhost:3002/api/health
# 4. Merge to main (also triggers staging)
git checkout main
@@ -101,7 +101,7 @@ docker compose -f docker-compose.staging.yml down
docker compose -f docker-compose.staging.yml logs -f
# Check staging health
curl http://localhost:3001/api/health
curl http://localhost:3002/api/health
```
### Production
@@ -142,7 +142,7 @@ curl http://localhost:3000/api/health
### Check Both Environments
```bash
# Staging
curl http://localhost:3001/api/health
curl http://localhost:3002/api/health
# Production
curl http://localhost:3000/api/health
@@ -174,11 +174,11 @@ docker ps | grep -v staging
4. Manual rollback: Restart old container if needed
### Port Conflicts
- Staging uses 3001, 5433, 6380
- Staging uses 3002, 5434, 6381
- Production uses 3000, 5432, 6379
- If conflicts occur, check what's using the ports:
```bash
lsof -i :3001
lsof -i :3002
lsof -i :3000
```