calibre-web-companion/deployment/entrypoints/start.sh

23 lines
623 B
Bash
Raw Permalink Normal View History

2021-03-05 13:32:42 +00:00
CAL_DIR="/app/content/"
DATA_DIR="/app/data/"
CWC_PATH="/app/CalibreWebCompanion"
if [ ! -d "$CAL_DIR" ]; then
echo "Calibre Library not mounted at the correct location."
echo "Mount it at /app/content/"
echo "Exiting..."
exit 1
fi
2021-03-02 03:09:15 +00:00
2021-03-05 13:32:42 +00:00
if [ ! -d "$DATA_DIR" ]; then
echo "A data directory not mounted at the correct location, exiting"
echo "This is used to store the database and logs"
echo "mount something at /app/data/"
echo "exiting"
exit 1
fi
cp -R -u -p "/app/CalibreWebCompanion/db.sqlite3" "/app/data/"
ls -l /app
python "${CWC_PATH}/manage.py" makemigrations
python "${CWC_PATH}/manage.py" migrate