Use docker volumes instead of bind mount for app data

This commit is contained in:
Girish Ramakrishnan
2018-09-13 13:55:49 -07:00
parent a0fd60408b
commit a46e208c63
9 changed files with 193 additions and 147 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
set -eu -o pipefail
if [[ ${EUID} -ne 0 ]]; then
echo "This script should be run as root." > /dev/stderr
exit 1
fi
if [[ $# -eq 0 ]]; then
echo "No arguments supplied"
exit 1
fi
if [[ "$1" == "--check" ]]; then
echo "OK"
exit 0
fi
# this script is called from redis addon as well!
appid="$1"
subdir="$2"
if [[ "${BOX_ENV}" == "cloudron" ]]; then
readonly volume_dir="${HOME}/appsdata/${appid}/${subdir}"
else
readonly volume_dir="${HOME}/.cloudron_test/appsdata/${appid}/${subdir}"
fi
rm -rf "${volume_dir}"