992 private links
Watchtower est un outil qui surveille vos conteneurs Docker et les met Ă jour automatiquement.
Ce script permet de :
- Identifier les LXC en ligne qui contiennent Docker.
- Trouver les fichiers
docker-compose.ymlde Watchtower.- Voir et modifier les options essentielles de Watchtower.
- Redémarrer automatiquement les containers aprÚs modification.
Le script est adapté pour des LXC dont le répertoire Watchtower se trouve dans
/rootou un sous-répertoire de/root.
TL;DR:
#!/bin/bash
# Gestion complĂšte de Watchtower dans LXC
MENU="
===============================================
Gestion de Watchtower dans les conteneurs LXC
===============================================
[1] đ Voir lâĂ©tat actuel de Watchtower
[2] đ DĂ©marrer Watchtower
[3] đ ArrĂȘter Watchtower
[4] đ RedĂ©marrer Watchtower
[5] đ Voir le contenu modifiable du docker-compose.yml de Watchtower
[6] đ Basculer restart policy (always â none)
[7] âïž Modifier WATCHTOWER_NO_STARTUP_MESSAGE (true/false)
[8] âïž Modifier WATCHTOWER_CLEANUP (true/false)
[9] đ
Modifier le schedule aléatoire (14h-20h, min multiples de 5)
[10] đ
Fixer le mĂȘme schedule pour tous (6 champs, Spring Cron)
[11] âïž Modifier WATCHTOWER_TIMEOUT
[Q] â Quitter
"
# Obtenir les LXC en ligne avec Docker
get_running_docker_lxc() {
pct list | awk 'NR>1 && $2=="running"{print $1}' | while read lxc; do
if pct exec "$lxc" -- docker ps >/dev/null 2>&1; then
echo "$lxc"
fi
done
}
# Trouver docker-compose.yml de watchtower avec timeout (5s)
find_watchtower_compose() {
lxc_id=$1
timeout 5s pct exec "$lxc_id" -- find /root -type f -path "*/watchtower/docker-compose.yml" 2>/dev/null | head -n1
}
# Afficher état Watchtower
status_watchtower() {
for lxc_id in $(get_running_docker_lxc); do
compose_file=$(find_watchtower_compose "$lxc_id")
echo "â LXC $lxc_id"
if [ -n "$compose_file" ]; then
pct exec "$lxc_id" -- docker ps --filter name=watchtower
else
echo "Pas de docker-compose.yml trouvé ou recherche expirée."
fi
done
read -rp "Appuyez sur [Entrée] pour revenir au menu..."
}
# Démarrer Watchtower
start_watchtower() {
for lxc_id in $(get_running_docker_lxc); do
compose_file=$(find_watchtower_compose "$lxc_id")
if [ -n "$compose_file" ]; then
dir=$(dirname "$compose_file")
pct exec "$lxc_id" -- sh -c "cd $dir && docker compose up -d"
echo "đ Watchtower dĂ©marrĂ© dans LXC $lxc_id"
else
echo "Pas de docker-compose.yml trouvé ou recherche expirée pour LXC $lxc_id."
fi
done
read -rp "Appuyez sur [Entrée] pour revenir au menu..."
}
# ArrĂȘter Watchtower
stop_watchtower() {
for lxc_id in $(get_running_docker_lxc); do
compose_file=$(find_watchtower_compose "$lxc_id")
if [ -n "$compose_file" ]; then
pct exec "$lxc_id" -- docker stop watchtower >/dev/null 2>&1
echo "đ Watchtower arrĂȘtĂ© dans LXC $lxc_id"
else
echo "Pas de docker-compose.yml trouvé ou recherche expirée pour LXC $lxc_id."
fi
done
read -rp "Appuyez sur [Entrée] pour revenir au menu..."
}
# Redémarrer Watchtower
restart_watchtower() {
for lxc_id in $(get_running_docker_lxc); do
compose_file=$(find_watchtower_compose "$lxc_id")
if [ -n "$compose_file" ]; then
dir=$(dirname "$compose_file")
pct exec "$lxc_id" -- sh -c "cd $dir && docker compose down && docker compose up -d"
echo "đ Watchtower redĂ©marrĂ© dans LXC $lxc_id"
else
echo "Pas de docker-compose.yml trouvé ou recherche expirée pour LXC $lxc_id."
fi
done
read -rp "Appuyez sur [Entrée] pour revenir au menu..."
}
# Voir le contenu modifiable du docker-compose.yml
view_compose() {
for lxc_id in $(get_running_docker_lxc); do
compose_file=$(find_watchtower_compose "$lxc_id")
echo "â LXC $lxc_id"
if [ -n "$compose_file" ]; then
pct exec "$lxc_id" -- sh -c "grep -E 'restart:|WATCHTOWER_NO_STARTUP_MESSAGE|WATCHTOWER_CLEANUP|WATCHTOWER_SCHEDULE|WATCHTOWER_TIMEOUT' $compose_file"
else
echo "Pas de docker-compose.yml trouvé ou recherche expirée pour LXC $lxc_id."
fi
done
read -rp "Appuyez sur [Entrée] pour revenir au menu..."
}
# Modifier une clé dans docker-compose.yml et redémarrer
modify_key_restart() {
key=$1
new_value=$2
for lxc_id in $(get_running_docker_lxc); do
compose_file=$(find_watchtower_compose "$lxc_id")
if [ -n "$compose_file" ]; then
pct exec "$lxc_id" -- sed -i "s|^\s*-\s*$key=.*| - $key=$new_value|" "$compose_file"
dir=$(dirname "$compose_file")
pct exec "$lxc_id" -- sh -c "cd $dir && docker compose down && docker compose up -d"
echo "â
$key mis à jour et Watchtower redémarré pour LXC $lxc_id"
else
echo "Pas de docker-compose.yml trouvé ou recherche expirée pour LXC $lxc_id."
fi
done
read -rp "Appuyez sur [Entrée] pour revenir au menu..."
}
# Basculer restart policy
toggle_restart() {
for lxc_id in $(get_running_docker_lxc); do
compose_file=$(find_watchtower_compose "$lxc_id")
if [ -n "$compose_file" ]; then
current=$(pct exec "$lxc_id" -- grep "restart:" "$compose_file" | awk '{print $2}')
if [ "$current" = "always" ]; then new="none"; else new="always"; fi
pct exec "$lxc_id" -- sed -i "s/^restart:.*/restart: $new/" "$compose_file"
dir=$(dirname "$compose_file")
pct exec "$lxc_id" -- sh -c "cd $dir && docker compose down && docker compose up -d"
echo "đ Restart policy basculĂ©e et Watchtower redĂ©marrĂ© dans LXC $lxc_id : $new"
else
echo "Pas de docker-compose.yml trouvé ou recherche expirée pour LXC $lxc_id."
fi
done
read -rp "Appuyez sur [Entrée] pour revenir au menu..."
}
# Schedule aléatoire (14h-20h, minutes multiples de 5) pour chaque LXC
random_schedule() {
for lxc_id in $(get_running_docker_lxc); do
compose_file=$(find_watchtower_compose "$lxc_id")
if [ -n "$compose_file" ]; then
hour=$((RANDOM % 7 + 14))
minute=$((RANDOM % 12 * 5))
schedule="0 $minute $hour ? * 5"
pct exec "$lxc_id" -- sed -i "s|^\s*-\s*WATCHTOWER_SCHEDULE=.*| - WATCHTOWER_SCHEDULE=$schedule|" "$compose_file"
dir=$(dirname "$compose_file")
pct exec "$lxc_id" -- sh -c "cd $dir && docker compose down && docker compose up -d"
echo "â
WATCHTOWER_SCHEDULE mis à jour et Watchtower redémarré pour LXC $lxc_id : $schedule"
else
echo "Pas de docker-compose.yml trouvé ou recherche expirée pour LXC $lxc_id."
fi
done
read -rp "Appuyez sur [Entrée] pour revenir au menu..."
}
# Schedule fixe pour tous (Spring cron, 6 champs)
fixed_schedule() {
read -rp "Entrez la valeur du schedule (ex: 0 0 16 ? * 5) : " schedule
modify_key_restart "WATCHTOWER_SCHEDULE" "$schedule"
}
# Menu principal
while true; do
clear
echo "$MENU"
read -rp "Votre choix : " choice
case $choice in
1) status_watchtower ;;
2) start_watchtower ;;
3) stop_watchtower ;;
4) restart_watchtower ;;
5) view_compose ;;
6) toggle_restart ;;
7) read -rp "Entrez true ou false pour WATCHTOWER_NO_STARTUP_MESSAGE : " val; modify_key_restart "WATCHTOWER_NO_STARTUP_MESSAGE" "$val" ;;
8) read -rp "Entrez true ou false pour WATCHTOWER_CLEANUP : " val; modify_key_restart "WATCHTOWER_CLEANUP" "$val" ;;
9) random_schedule ;;
10) fixed_schedule ;;
11) read -rp "Entrez la valeur pour WATCHTOWER_TIMEOUT (ex: 30s) : " val; modify_key_restart "WATCHTOWER_TIMEOUT" "$val" ;;
[Qq]) exit ;;
*) echo "Option invalide." ; read -rp "Appuyez sur [Entrée] pour continuer..." ;;
esac
doneTable of contents
Optimisez vos opérations grùce à notre plateforme tout-en-un : idéale pour gérer vos projets, données et l'état de vos systÚmes avec simplicité et efficacité.
Ce tutoriel vous guidera pour dĂ©ployer une instance n8n robuste, sĂ©curisĂ©e et prĂȘte pour la production sur un serveur Ubuntu 22.04 LTS. Nous utiliserons la pile technologique suivante :
- n8n : La plateforme dâautomatisation des workflows.
- PostgreSQL : Une base de données puissante pour vos données.
- Traefik : Un reverse proxy moderne pour la gestion HTTPS.
- Docker & Docker Compose : Pour conteneuriser nos services.
Table des MatiĂšres
- 1. Prérequis
- 2. Configuration Initiale du Serveur (Ubuntu 22.04)
- 3. Création du Réseau Partagé
- 4. DĂ©ploiement de Traefik đŠ
- 5. DĂ©ploiement de n8n avec PostgreSQL đ
- 6. Configuration dâun accĂšs SFTP sĂ©curisĂ© (Optionnel)
- 7. Sauvegarde et Maintenance
- b. Restauration
- c. test de restauration
- Ătape 2 : Lancer le test
- Ătape 3 : VĂ©rifier lâaccĂšs
- Ătape 4 : Nettoyer
- d. Gestion des Logs Docker
- 8. AccĂšs et Finalisation
Running the Greenbone Community Edition from containers requires knowledge about: Using a terminal, Using docker, Running services via docker compose. Additionally, a basic knowledge about the arch...
Part 3 of my in depth tutorial series on building a modern full-stack web app, using Java with Spring Boot, Javascript with Vue and NuxtJS, Docker, Heroku, Gitlab CI/CD. The goal of this part is that we want to prepare our web-apps for easy and modern deployment. We want to be able to quickly run our front- and backend on any machine and have the ability to scale the application if needed.
At this point we have a front- and backend that runs perfectly on our local machine. While this tutorial will make more sense if you completed the previous parts, it can also be helpful in general. The goal of this part is that we want to prepare our web-apps for easy and modern deployment. We want to be able to quickly run our front- and backend on any machine and have the ability to scale the application if needed. As with everything else there are plenty of ways to accomplish it. For this series we will work with Docker as it has gained incredible popularity over the past years. This tutorial is split into four subparts:
- What is Docker?
- Dockerizing the frontend
- Dockerizing the backend
- Running it all at once
Retrouvez ici la liste de toutes les applications Docker prĂ©sentes sur belginux. Il suffit de cliquer sur l'image pour atteindre le tutoriel. Il me reste Ă peaufiner certains classements qui sont un peu Ă la masse, ça vient. đ
Compose craft is a tool to help you manage, edit and share docker compose files in a GUI way.
Find, install and publish Cloud Native packages
Make your web services secure by default with BunkerWeb, the open source and next generation WAF.
The concept of containerization itself is pretty old. But the emergence of the Docker Engine in 2013 has made it much easier to containerize your applications.