33800 Docs

← Retour
#!/bin/bash # =========================================== # MOTD - Message of the Day - PROD-PORTAINER # =========================================== # Couleurs CYAN='\033[0;36m' GREEN='\033[0;32m' YELLOW='\033[1;33m' RED='\033[0;31m' DIM='\033[2m' BOLD='\033[1m' NC='\033[0m' # Compter les containers RUNNING=$(docker ps --format '{{.Names}}' 2>/dev/null | wc -l) echo -e "${CYAN}" cat << 'EOF' ╔══════════════════════════════════════════════════════════════════╗ ║ 🚀 PROD-PORTAINER - Docker Production ║ ╠══════════════════════════════════════════════════════════════════╣ EOF echo -e "${NC}" echo -e "${BOLD} 📦 DOCKER${NC}" echo -e " ${GREEN}docker ps${NC} Containers actifs" echo -e " ${GREEN}docker logs${NC} <container> Voir les logs" echo -e " ${GREEN}docker stats${NC} Ressources en temps réel" echo -e " ${GREEN}docker system df${NC} Espace disque Docker" echo "" echo -e "${BOLD} 🚀 DÉPLOIEMENT${NC}" echo -e " ${GREEN}deploy${NC} <projet> <env> Déploie tout un projet" echo -e " ${GREEN}deploy${NC} <projet> <env> <svc> Déploie un service" echo "" echo -e "${BOLD} 🔧 GESTION${NC}" echo -e " ${GREEN}health${NC} État de tous les containers" echo -e " ${GREEN}logs${NC} <container> Voir les logs (alias)" echo -e " ${GREEN}restart${NC} <container> Redémarrer un container" echo "" echo -e "${BOLD} 🌐 NGINX${NC}" echo -e " ${GREEN}nginx-list${NC} Liste les configs actives" echo -e " ${GREEN}nginx-test${NC} Test la configuration" echo -e " ${GREEN}nginx-deploy${NC} <file> Déploie une config" echo "" echo -e "${BOLD} 🌍 DNS (o2switch)${NC}" echo -e " ${GREEN}dns-list${NC} Liste les enregistrements" echo -e " ${GREEN}dns-wildcards${NC} Liste les wildcards" echo -e " ${GREEN}dns-ssl-check${NC} Vérifie expiration SSL" echo "" echo -e "${BOLD} 📁 CHEMINS${NC}" echo -e " Docker data: /mnt/stock_36to/data/docker/prod/" echo -e " Scripts: /mnt/stock_36to/data/docker/scripts/" echo -e " Secrets: /mnt/stock_36to/data/docker/secrets/" echo "" echo -e "${BOLD} ℹ️ INFOS${NC}" echo -e " ${GREEN}status${NC} Résumé complet du serveur" echo -e " ${GREEN}help${NC} Affiche ce menu" echo "" echo -e "${CYAN}╚══════════════════════════════════════════════════════════════════╝${NC}" echo "" echo -e "${DIM}Containers actifs: ${NC}${GREEN}$RUNNING${NC}${DIM} | IP: 192.168.1.11 | Portainer: https://prod-portainer.local:9443${NC}" echo "" # Check mises à jour UPDATES=$(apt list --upgradable 2>/dev/null | grep -c upgradable) if [ "$UPDATES" -gt 0 ]; then echo -e "${YELLOW} ⚠️ MISES À JOUR DISPONIBLES: $UPDATES paquet(s)${NC}" echo -e "${DIM} sudo apt update && sudo apt upgrade -y${NC}" echo "" else echo -e "${GREEN} ✅ Système à jour${NC}" echo "" fi