6.6 KiB
Marketing Dev Frontend Configuration Analysis
Date: 2025-01-XX
Status: ✅ FIXED - All issues resolved
Executive Summary
Analysis of the marketing dev frontend container and configuration reveals:
- ✅ Architecture Consistency: Follows existing architecture (separate containers)
- ✅ No Parallel Builds: Uses
image:notbuild:to avoid conflicts - ✅ Caddy Routing: Correctly configured for dev mode
- ✅ Network Configuration: All containers on
igny8_netnetwork - ⚠️ FIXED: Port mismatch in production marketing container
Configuration Analysis
1. Container Configuration ✅
igny8_marketing_dev (Development)
- Image:
igny8-marketing-dev:latest - Ports:
8023:5174(external:internal) - Volume Mount:
/data/app/igny8/frontend:/app:rw(live reload) - Network:
igny8_net - Status: ✅ Correctly configured
igny8_marketing (Production)
- Image:
igny8-marketing:latest - Ports:
8022:8020(external:internal) - FIXED - Network:
igny8_net - Status: ✅ Fixed - now matches Dockerfile.marketing (port 8020)
2. Dockerfile Configuration ✅
Dockerfile.marketing.dev
- Base:
node:18-alpine - Port:
5174(Vite dev server) - Command:
npm run dev:marketing - Status: ✅ Correct
Dockerfile.marketing
- Base:
caddy:latest(multi-stage build) - Port:
8020(Caddy server) - Command:
caddy run --config /etc/caddy/Caddyfile - Status: ✅ Correct
3. Caddy Routing Configuration ✅
Main Caddyfile Location: /var/lib/docker/volumes/portainer_data/_data/caddy/Caddyfile
Current Configuration (Dev Mode):
igny8.com {
reverse_proxy igny8_marketing_dev:5174 {
# WebSocket support for HMR
header_up Connection {>Connection}
header_up Upgrade {>Upgrade}
}
}
Status: ✅ Correctly routing to dev container with HMR support
Production Mode (when switching):
igny8.com {
reverse_proxy igny8_marketing:8020 {
# Static production build
}
}
4. Package.json Scripts ✅
dev:marketing:vite --host 0.0.0.0 --port 5174 --force marketing.html✅build:marketing:vite build --mode marketing✅
Status: ✅ All scripts correctly configured
5. Network Architecture ✅
All containers are on the igny8_net external network:
- ✅
igny8_marketing_dev→igny8_net - ✅
igny8_marketing→igny8_net - ✅
igny8_frontend→igny8_net - ✅
igny8_backend→igny8_net - ✅
igny8_caddy→igny8_net
Status: ✅ All containers can communicate via container names
Issues Found & Fixed
Issue 1: Port Mismatch in Production Container ⚠️ → ✅ FIXED
Problem:
docker-compose.app.ymlmapped8022:5174forigny8_marketing- But
Dockerfile.marketingexposes port8020(Caddy) - This would cause connection failures when Caddy routes to production
Fix Applied:
# Before
ports:
- "0.0.0.0:8022:5174" # WRONG
# After
ports:
- "0.0.0.0:8022:8020" # CORRECT - matches Caddy port
Status: ✅ Fixed in docker-compose.app.yml
Architecture Consistency Check
✅ Follows Existing Architecture
-
Separate Containers: ✅
- Dev and production containers are separate
- Matches architecture principle (Option A from DEPLOYMENT_ARCHITECTURE.md)
-
No Parallel Builds: ✅
- Uses
image:notbuild:in docker-compose - Prevents Portainer/CLI conflicts
- Images built separately as documented
- Uses
-
Network Isolation: ✅
- All containers on
igny8_net - External network (shared with infra stack)
- Container name resolution works
- All containers on
-
Port Allocation: ✅
8021: Frontend dev (app)8022: Marketing production8023: Marketing dev- No conflicts
-
Volume Mounts: ✅
- Dev container has volume mount for HMR
- Production container is stateless (built image)
Accessibility Verification
✅ All Services Accessible
-
Direct Access:
- Marketing Dev:
http://localhost:8023✅ - Marketing Prod:
http://localhost:8022✅ - Frontend Dev:
http://localhost:8021✅
- Marketing Dev:
-
Through Caddy (HTTPS):
https://igny8.com→igny8_marketing_dev:5174(dev mode) ✅https://app.igny8.com→igny8_frontend:5173✅https://api.igny8.com→igny8_backend:8010✅
-
WebSocket Support:
- Caddy configured with WebSocket headers for HMR ✅
- Dev container supports HMR ✅
Gaps & Parallel Builds Check
✅ No Gaps Found
- Container Definitions: All containers defined in
docker-compose.app.yml - Dockerfiles: All Dockerfiles exist and are correct
- Caddyfile: Routing configured correctly
- Scripts: All npm scripts exist in package.json
- Network: All containers on same network
✅ No Parallel Builds
- docker-compose.app.yml: Uses
image:notbuild:✅ - Build Instructions: Clear documentation to build separately ✅
- No Conflicts: Portainer and CLI can use same compose file ✅
Summary
✅ Configuration Status
| Component | Status | Notes |
|---|---|---|
| Container Config | ✅ Fixed | Port mismatch corrected |
| Dockerfiles | ✅ Correct | All ports match |
| Caddy Routing | ✅ Correct | Dev mode active |
| Network | ✅ Correct | All on igny8_net |
| Scripts | ✅ Correct | All npm scripts exist |
| Architecture | ✅ Consistent | Follows existing patterns |
| Accessibility | ✅ Accessible | All services reachable |
| No Gaps | ✅ Complete | All components present |
| No Parallel Builds | ✅ Clean | Uses image: not build: |
✅ All Issues Resolved
- ✅ Port mismatch fixed in
docker-compose.app.yml - ✅ Configuration consistent with architecture
- ✅ All services accessible
- ✅ No gaps or parallel builds
Recommendations
Current Setup (Dev Mode)
- ✅ Marketing dev container is active and accessible
- ✅ HMR working through Caddy
- ✅ All routing correct
For Production Deployment
- Build production image:
docker build -t igny8-marketing:latest -f Dockerfile.marketing . - Update Caddyfile to route to
igny8_marketing:8020 - Restart Caddy:
docker compose restart caddy
Conclusion
The marketing dev frontend container and configuration are:
- ✅ Consistent with existing architecture
- ✅ Fully configured and accessible
- ✅ No gaps or missing components
- ✅ No parallel builds - clean configuration
All issues have been identified and fixed. The system is ready for use.