mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 08:57:11 +01:00
52 lines
1.6 KiB
Docker
52 lines
1.6 KiB
Docker
FROM node:19.1.0-alpine3.16
|
|
|
|
# Arguments
|
|
ARG APP_HOME=/home/node/app
|
|
|
|
# Install system dependencies
|
|
RUN apk add gcompat tini git
|
|
|
|
# Ensure proper handling of kernel signals
|
|
ENTRYPOINT [ "tini", "--" ]
|
|
|
|
# Create app directory
|
|
WORKDIR ${APP_HOME}
|
|
|
|
# Install app dependencies
|
|
COPY package*.json post-install.js ./
|
|
RUN \
|
|
echo "*** Install npm packages ***" && \
|
|
npm install && npm cache clean --force
|
|
|
|
# Bundle app source
|
|
COPY . ./
|
|
|
|
# Copy default chats, characters and user avatars to <folder>.default folder
|
|
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" && \
|
|
\
|
|
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 && \
|
|
\
|
|
ln -s "./config/config.yaml" "config.yaml" || true && \
|
|
ln -s "../config/settings.json" "public/settings.json" || true && \
|
|
ln -s "../../config/bg_load.css" "public/css/bg_load.css" || true && \
|
|
mkdir "config" || true
|
|
|
|
# Cleanup unnecessary files
|
|
RUN \
|
|
echo "*** Cleanup ***" && \
|
|
mv "./docker/docker-entrypoint.sh" "./" && \
|
|
rm -rf "./docker" && \
|
|
echo "*** Make docker-entrypoint.sh executable ***" && \
|
|
chmod +x "./docker-entrypoint.sh" && \
|
|
echo "*** Convert line endings to Unix format ***" && \
|
|
dos2unix "./docker-entrypoint.sh"
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD [ "./docker-entrypoint.sh" ]
|