mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Concise Dockerfile and entrypoint
This commit is contained in:
@ -1,28 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check if the "characters" directory is empty
|
||||
if [ ! -e "/home/node/app/config/characters" ]; then
|
||||
echo "Characters directory not found. Copying default characters."
|
||||
mv /home/node/app/public/characters.default /home/node/app/config/characters
|
||||
fi
|
||||
|
||||
# Check if the "chats" directory is empty
|
||||
if [ ! -e "/home/node/app/config/chats" ]; then
|
||||
echo "Chats directory not found. Copying default chats."
|
||||
mv /home/node/app/public/chats.default /home/node/app/config/chats/
|
||||
fi
|
||||
|
||||
# Check if the "User Avatars" directory is empty
|
||||
if [ ! -e "/home/node/app/config/User Avatars" ]; then
|
||||
echo "User Avatars directory not found. Copying default user avatars."
|
||||
mv /home/node/app/public/User\ Avatars.default /home/node/app/config/User\ Avatars/
|
||||
fi
|
||||
|
||||
# Check if the "settings.json" file is not empty
|
||||
if [ ! -e "/home/node/app/config/settings.json" ]; then
|
||||
echo "Settings file not found. Copying default settings."
|
||||
mv /home/node/app/public/settings.json.default /home/node/app/config/settings.json
|
||||
fi
|
||||
# Initialize missing user files
|
||||
IFS="," RESOURCES="characters,chats,User Avatars,settings.json"
|
||||
for R in $RESOURCES; do
|
||||
if [ ! -e "config/$R" ]; then
|
||||
echo "Resource not found, copying from defaults: $R"
|
||||
cp -r "public/$R.default" "config/$R"
|
||||
fi
|
||||
done
|
||||
|
||||
# Start the server
|
||||
exec node /home/node/app/server.js
|
||||
exec node server.js
|
||||
|
Reference in New Issue
Block a user