Initial commit: Full project structure
- Backend: NestJS with Docker - Frontend: Next.js with Docker - Nginx configuration for reverse proxy - PostgreSQL setup - Docker compose for orchestration - Development environment configuration
This commit is contained in:
32
infrastructure/scripts/monitor.sh
Normal file
32
infrastructure/scripts/monitor.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo "=== Dyolink Health Monitor ==="
|
||||
echo "Time: $(date)"
|
||||
echo ""
|
||||
|
||||
# Check containers
|
||||
echo "Container Status:"
|
||||
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Health}}" | grep dyolink
|
||||
|
||||
# Check resources
|
||||
echo -e "\nResource Usage:"
|
||||
docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" | grep dyolink
|
||||
|
||||
# Check disk
|
||||
DISK=$(df -h / | awk 'NR==2 {print $5}' | tr -d '%')
|
||||
if [ $DISK -gt 80 ]; then
|
||||
echo -e "\n${RED}⚠ WARNING: Disk usage at ${DISK}%${NC}"
|
||||
else
|
||||
echo -e "\n${GREEN}✓ Disk usage: ${DISK}%${NC}"
|
||||
fi
|
||||
|
||||
# Check API
|
||||
echo -e "\nAPI Health:"
|
||||
curl -s -o /dev/null -w "Backend API: %{http_code}\n" http://localhost:3001/api/health || echo "Backend API: DOWN"
|
||||
curl -s -o /dev/null -w "Frontend: %{http_code}\n" http://localhost:3002 || echo "Frontend: DOWN"
|
||||
Reference in New Issue
Block a user