#
Docker 安装指南
本指南假设您在非 root(非管理员)文件夹中安装 SillyTavern。如果您在 root 文件夹中安装 SillyTavern,您可能需要使用管理员权限运行某些命令[sudo
、doas
、Command Prompt (Administrator)]。
#
安装
#
Linux
请按照此处的 Docker 安装指南安装 Docker。
不要安装 Docker Desktop。
按照 Docker 安装后配置指南中的以非 root 用户身份管理 Docker部分进行操作。
使用包管理器安装 Git。
Debian (Ubuntu/Pop! OS/等)
sudo apt install git
Arch Linux (Manjaro/EndeavourOS/等)
sudo pacman -S git
Fedora, Red Hat Enterprise Linux (RHEL), 等
sudo dnf install git
克隆 SillyTavern 仓库。
Release (稳定分支)
git clone https://github.com/SillyTavern/SillyTavern && cd SillyTavern/docker
Staging (开发分支)
git clone https://github.com/SillyTavern/SillyTavern -b staging && cd SillyTavern/docker
在 Docker 文件夹中运行以下命令执行
docker compose
。docker compose up -d
执行以下 Docker 命令获取 SillyTavern Docker 容器的 IP 地址。
docker network inspect docker_default
您应该会看到类似下面的输出:
[ { "Name": "docker_default", "IPAM": { "Config": [ { "Subnet": "172.18.0.0/16", "Gateway": "172.18.0.1" } ] } } ]
记下您在 Gateway 中看到的 IP 地址,这很重要。
使用
sudo
打开nano
并运行以下命令:sudo nano config/config.yaml
在
nano
中,找到whitelist
。您应该会看到类似下面的内容:whitelist: - 127.0.0.1
在 127.0.0.1 下面添加一行,输入您从 Docker 复制的 IP 地址。完成后应该类似这样:
whitelist: - 127.0.0.1 - 172.18.0.1
按 Ctrl+S 保存文件,然后按 Ctrl+X 退出
nano
。注意,如果您将 Docker 网络配置为桥接模式,您也可以像往常一样将外部 IP 地址添加到白名单中。
重启 Docker 容器以应用新配置。
docker compose restart sillytavern
打开新的浏览器并访问 http://localhost:8000。几分钟后您应该就能看到 SillyTavern 加载完成。
尽情享用! :D
#
Windows
关于 Windows 上的 Docker
在 Windows 上使用 Docker 非常复杂。您不仅需要在"启用或关闭 Windows 功能"中激活 Windows Subsystem for Linux,还需要为虚拟化配置系统(Intel VT-d/AMD SVM),这因 PC 制造商(或主板制造商)而异。有时,某些系统上甚至没有这个选项。
强烈建议您按照我们的 Windows 指南安装 SillyTavern。本节仅是在 Windows 上安装的一个_粗略_思路。
按照此处的 Docker 安装指南安装 Docker Desktop。
安装 Git for Windows。
克隆 SillyTavern 仓库。
Release (稳定分支)
git clone https://github.com/SillyTavern/SillyTavern && cd SillyTavern/docker
Staging (开发分支)
git clone https://github.com/SillyTavern/SillyTavern -b staging && cd SillyTavern/docker
在 Docker 文件夹中运行以下命令执行
docker compose
。docker compose up -d
执行以下 Docker 命令获取 SillyTavern Docker 容器的 IP 地址。
docker network inspect docker_default
您应该会看到类似下面的输出:
[ { "Name": "docker_default", "IPAM": { "Config": [ { "Subnet": "172.18.0.0/16", "Gateway": "172.18.0.1" } ] } } ]
记下您在 Gateway 中看到的 IP 地址,这很重要。
以管理员权限运行 Notepad 或您选择的代码编辑器,进入
config
目录并打开 config.yaml。在您选择的编辑器中,您应该会看到类似下面的内容:
whitelist: - 127.0.0.1
在 127.0.0.1 下面添加一行,输入您从 Docker 复制的 IP 地址。完成后应该类似这样:
whitelist: - 127.0.0.1 - 172.18.0.1
按 Ctrl+S 保存文件,然后退出编辑器。
注意,如果您将 Docker 网络配置为桥接模式,您也可以像往常一样将外部 IP 地址添加到白名单中。
重启 Docker 容器以应用新配置。
docker compose restart sillytavern
打开新的浏览器并访问 http://localhost:8000。几分钟后您应该就能看到 SillyTavern 加载完成。
尽情享用! :D
#
macOS
尽管 macOS 与 Linux 类似,但它没有 Docker Engine。您需要像 Windows 一样安装 Docker Desktop。 您还需要安装 Homebrew 以在 Mac 上安装 Git。本节仅是在 macOS 上安装的一个_粗略_思路。
按照此处的 Docker 安装指南安装 Docker Desktop。
使用 Homebrew 安装
git
。brew install git
克隆 SillyTavern 仓库。
Release (稳定分支)
git clone https://github.com/SillyTavern/SillyTavern && cd SillyTavern/docker
Staging (开发分支)
git clone https://github.com/SillyTavern/SillyTavern -b staging && cd SillyTavern/docker
在 Docker 文件夹中运行以下命令执行
docker compose
。docker compose up -d
执行以下 Docker 命令获取 SillyTavern Docker 容器的 IP 地址。
docker network inspect docker_default
您应该会看到类似下面的输出:
[ { "Name": "docker_default", "IPAM": { "Config": [ { "Subnet": "172.18.0.0/16", "Gateway": "172.18.0.1" } ] } } ]
记下您在 Gateway 中看到的 IP 地址,这很重要。
使用
sudo
打开nano
并运行以下命令。sudo nano config/config.yaml
If you can't run
nano
, either install it via Homebrew or use TextEdit.Within
nano
, go down towhitelist
. You should see something similar to the following below.whitelist: - 127.0.0.1
Add a new line below 127.0.0.1 and put in the IP you copied from Docker. It should look something similar to the following afterwards.
whitelist: - 127.0.0.1 - 172.18.0.1
Save the file by pressing Ctrl+S then exit
nano
by pressing Ctrl+X.Note that if you configured Docker network as a bridge, you could also add external IP addresses to the whitelist as usual.
Restart the Docker Container to apply the new configuration.
docker compose restart sillytavern
Open an new browser and go to http://localhost:8000. You should see SillyTavern load in a few moments.
Enjoy! :D
#
Configuring SillyTavern
SillyTavern's configuration file (config.yaml) will be located within the config
folder. Configuring the config file should be no different than configuring it without Docker, however you will need to run nano
or a code editor with administrator rights in order to save your changes.
Don't forget to restart the Docker container for SillyTavern in order to apply your changes! Make sure you execute this command within the docker
folder.
docker compose restart sillytavern
#
Locating User Data
SillyTavern's data folder will be within the data
folder. Backing up your files should be easy to do, however, restoring or adding content into it may require you to do so with administrator rights.
#
Running Server Plugins
Running plugins like HoYoWiki-Scraper-TS or SillyTavern-Fandom-Scraper within Docker is no different from running it on your system without Docker, however we will need to do a slight modification to the Docker Compose script in order to do so.
Note
If you already see a plugins folder within the docker
folder, you can skip Steps 1-2.
Using
nano
or a code editor, open docker-compose.yml and add the following line belowvolumes
.volumes: - "./config:/home/node/app/config" - "./data:/home/node/app/data" - "./plugins:/home/node/app/plugins"
Create a new folder within the
docker
folder called plugins.Follow your plugin's instructions on installing the plugin.
Using
nano
or a code editor with administrator rights, open config.yaml (within theconfig
folder) and enableenableServerPlugins
enableServerPlugins: true
Restart the Docker container.
docker compose restart sillytavern
Profit.