mirror of
https://github.com/skylanix/MamieHenriette.git
synced 2026-02-06 06:40:35 +01:00
date heure pour le fichiers log et max retry corrigé
This commit is contained in:
@@ -35,6 +35,6 @@ RUN python3 -m venv /app/venv && \
|
|||||||
mkdir -p /app/logs
|
mkdir -p /app/logs
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD pgrep python > /dev/null && ! (tail -n 1000 /app/logs/*.log 2>/dev/null | grep -iE "(ERROR|CRITICAL|Exception|sqlite3\.OperationalError)") || exit 1
|
CMD pgrep python > /dev/null && ! (tail -n 1000 $(ls -t /app/logs/*.log 2>/dev/null | head -1) 2>/dev/null | grep -iE "(ERROR|CRITICAL|Exception|sqlite3\.OperationalError)") || (echo "Healthcheck échoué, arrêt du conteneur" && kill 1)
|
||||||
|
|
||||||
CMD ["/start.sh"]
|
CMD ["/start.sh"]
|
||||||
|
|||||||
3
start.sh
3
start.sh
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Démarrage du bot Discord..."
|
echo "Démarrage du bot Discord..."
|
||||||
|
LOG_FILE="/app/logs/$(date '+%Y%m%d_%H%M%S').log"
|
||||||
exec /app/venv/bin/python run-web.py 2>&1 | while IFS= read -r line; do
|
exec /app/venv/bin/python run-web.py 2>&1 | while IFS= read -r line; do
|
||||||
echo "$(date '+%Y-%m-%d %H:%M:%S%z') $line" | tee -a /app/logs/$(hostname).log # RFC 3339 / ISO 8601
|
echo "$(date '+%Y-%m-%d %H:%M:%S%z') $line" | tee -a "$LOG_FILE" # RFC 3339 / ISO 8601
|
||||||
done
|
done
|
||||||
Reference in New Issue
Block a user