V4.x Docker Refactoring and Docs

This commit is contained in:
Ariel Rin
2023-08-14 03:05:44 +00:00
parent 4aff4006e3
commit 4305ae7995
14 changed files with 297 additions and 108 deletions

27
docker/conf/memory_check.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
max_mem=$1
cur_mem=$(</sys/fs/cgroup/memory.current)
health_file="/tmp/health.stat"
if [ -f "$health_file" ]; then
echo "$health_file exists."
else
echo "$health_file does not exist. Creating"
echo 0 > "$health_file"
fi
health=$(<$health_file)
echo "Testing Mem: $cur_mem / $max_mem"
if [[ max_mem -gt cur_mem ]]
then
echo 0 > "$health_file"
echo "All Ok"
exit 0
else
new_val=$((1+$health))
echo "Un-healthy! Check #$new_val"
echo $new_val > "$health_file"
if (($new_val > 3)); then
echo "Starting a restart of this the container..."
kill -SIGTERM 1
fi
exit 1
fi