mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-17 19:59:42 +01:00
Adapt Docker files to neo-server data migration
This commit is contained in:
parent
396eeca73a
commit
a3da248e3c
@ -4,6 +4,7 @@ npm-debug.log
|
|||||||
readme*
|
readme*
|
||||||
Start.bat
|
Start.bat
|
||||||
/dist
|
/dist
|
||||||
/backups/
|
/backups
|
||||||
cloudflared.exe
|
cloudflared.exe
|
||||||
access.log
|
access.log
|
||||||
|
/data
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,6 +25,7 @@ public/stats.json
|
|||||||
/docker/config
|
/docker/config
|
||||||
/docker/user
|
/docker/user
|
||||||
/docker/extensions
|
/docker/extensions
|
||||||
|
/docker/data
|
||||||
.DS_Store
|
.DS_Store
|
||||||
public/settings.json
|
public/settings.json
|
||||||
/thumbnails
|
/thumbnails
|
||||||
|
16
Dockerfile
16
Dockerfile
@ -1,4 +1,4 @@
|
|||||||
FROM node:19.1.0-alpine3.16
|
FROM node:lts-alpine3.18
|
||||||
|
|
||||||
# Arguments
|
# Arguments
|
||||||
ARG APP_HOME=/home/node/app
|
ARG APP_HOME=/home/node/app
|
||||||
@ -26,19 +26,9 @@ COPY . ./
|
|||||||
|
|
||||||
# Copy default chats, characters and user avatars to <folder>.default folder
|
# Copy default chats, characters and user avatars to <folder>.default folder
|
||||||
RUN \
|
RUN \
|
||||||
IFS="," RESOURCES="assets,backgrounds,user,context,instruct,QuickReplies,movingUI,themes,characters,chats,groups,group chats,User Avatars,worlds,OpenAI Settings,NovelAI Settings,KoboldAI Settings,TextGen Settings" && \
|
rm -f "config.yaml" || true && \
|
||||||
\
|
|
||||||
echo "*** Store default $RESOURCES in <folder>.default ***" && \
|
|
||||||
for R in $RESOURCES; do mv "public/$R" "public/$R.default"; done || true && \
|
|
||||||
\
|
|
||||||
echo "*** Create symbolic links to config directory ***" && \
|
|
||||||
for R in $RESOURCES; do ln -s "../config/$R" "public/$R"; done || true && \
|
|
||||||
\
|
|
||||||
rm -f "config.yaml" "public/settings.json" || true && \
|
|
||||||
ln -s "./config/config.yaml" "config.yaml" || true && \
|
ln -s "./config/config.yaml" "config.yaml" || true && \
|
||||||
ln -s "../config/settings.json" "public/settings.json" || true && \
|
mkdir "config" || true
|
||||||
mkdir "config" || true && \
|
|
||||||
mkdir -p "public/user" || true
|
|
||||||
|
|
||||||
# Cleanup unnecessary files
|
# Cleanup unnecessary files
|
||||||
RUN \
|
RUN \
|
||||||
|
@ -8,7 +8,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- "./extensions:/home/node/app/public/scripts/extensions/third-party"
|
|
||||||
- "./config:/home/node/app/config"
|
- "./config:/home/node/app/config"
|
||||||
- "./user:/home/node/app/public/user"
|
- "./data:/home/node/app/data"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -1,38 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Initialize missing user files
|
|
||||||
IFS="," RESOURCES="assets,backgrounds,user,context,instruct,QuickReplies,movingUI,themes,characters,chats,groups,group chats,User Avatars,worlds,OpenAI Settings,NovelAI Settings,KoboldAI Settings,TextGen Settings"
|
|
||||||
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
|
|
||||||
|
|
||||||
if [ ! -e "config/config.yaml" ]; then
|
if [ ! -e "config/config.yaml" ]; then
|
||||||
echo "Resource not found, copying from defaults: config.yaml"
|
echo "Resource not found, copying from defaults: config.yaml"
|
||||||
cp -r "default/config.yaml" "config/config.yaml"
|
cp -r "default/config.yaml" "config/config.yaml"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "config/settings.json" ]; then
|
|
||||||
echo "Resource not found, copying from defaults: settings.json"
|
|
||||||
cp -r "default/settings.json" "config/settings.json"
|
|
||||||
fi
|
|
||||||
|
|
||||||
CONFIG_FILE="config.yaml"
|
CONFIG_FILE="config.yaml"
|
||||||
|
|
||||||
echo "Starting with the following config:"
|
echo "Starting with the following config:"
|
||||||
cat $CONFIG_FILE
|
cat $CONFIG_FILE
|
||||||
|
|
||||||
if grep -q "listen: false" $CONFIG_FILE; then
|
|
||||||
echo -e "\033[1;31mThe listen parameter is set to false. If you can't connect to the server, edit the \"docker/config/config.yaml\" file and restart the container.\033[0m"
|
|
||||||
sleep 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
if grep -q "whitelistMode: true" $CONFIG_FILE; then
|
|
||||||
echo -e "\033[1;31mThe whitelistMode parameter is set to true. If you can't connect to the server, edit the \"docker/config/config.yaml\" file and restart the container.\033[0m"
|
|
||||||
sleep 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start the server
|
# Start the server
|
||||||
exec node server.js
|
exec node server.js --listen
|
||||||
|
6
start.sh
6
start.sh
@ -21,12 +21,6 @@ then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if running on replit patch whitelist
|
|
||||||
if [ ! -z "$REPL_ID" ]; then
|
|
||||||
echo -e "Running on Repl.it... \nPatching Whitelist..."
|
|
||||||
sed -i 's|whitelistMode = true|whitelistMode = false|g' "config.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Installing Node Modules..."
|
echo "Installing Node Modules..."
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
npm i --no-audit --no-fund --quiet --omit=dev
|
npm i --no-audit --no-fund --quiet --omit=dev
|
||||||
|
Loading…
Reference in New Issue
Block a user