Run docker image as non-root user

This commit is contained in:
Aaron Reisman 2024-10-18 00:13:19 -05:00
parent 6dcf456d06
commit 7d4eaa11e7
3 changed files with 15 additions and 25 deletions

3
Docker/appsettings.json Normal file
View file

@ -0,0 +1,3 @@
{
"LibationFiles": "/config"
}

View file

@ -19,18 +19,6 @@ fi
echo ""
# Check if the config directory is passed in, and there is no link to it then create the link.
if [ -d "/config" ] && [ ! -d "/root/Libation" ]; then
echo "Linking config directory to the Libation config directory"
ln -s /config/ /root/Libation
fi
# If no config error and exit
if [ ! -d "/config" ]; then
echo "ERROR: No /config directory. You must pass in a volume containing your config mapped to /config"
exit 1
fi
# If user passes in db from a /db/ folder and a db does not already exist / is not already linked
FILE=/db/LibationContext.db
if [ -f "${FILE}" ] && [ ! -f "/config/LibationContext.db" ]; then
@ -38,12 +26,6 @@ if [ -f "${FILE}" ] && [ ! -f "/config/LibationContext.db" ]; then
ln -s $FILE /config/LibationContext.db
fi
# Confirm we have a db in the config direcotry.
if [ ! -f "/config/LibationContext.db" ]; then
echo "ERROR: No Libation database detected, exiting."
exit 1
fi
# ################################
# Loop and liberate
# ################################
@ -65,4 +47,4 @@ do
sleep "${SLEEP_TIME}"
done
echo "Exiting"
echo "Exiting"