File size: 804 Bytes
c8a6ceb
 
 
6c172aa
 
 
c8a6ceb
 
 
6c172aa
 
c8a6ceb
 
0309b24
c8a6ceb
 
da1104d
c8a6ceb
 
 
 
1585899
21c73c3
6c172aa
 
 
 
c8a6ceb
 
 
 
d5a3d7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 使用Node.js镜像作为基础镜像
FROM node:latest

ARG username=user
ARG password=password

# 设置工作目录
WORKDIR /app

# 安装git和sed,并创建用户
RUN apt-get update && apt-get install -y git sed && chown -R node:node /app

# 切换到新用户
USER node

# 克隆SillyTavern仓库
RUN git clone https://github.com/SillyTavern/SillyTavern -b release

# 切换工作目录到克隆的仓库中
WORKDIR /app/SillyTavern

COPY config.yaml ./config.yaml

# 使用sed替换config.yaml中的用户名和密码
RUN sed -i "s/username: \"user\"/username: \"$username\"/" config.yaml && \
    sed -i "s/password: \"password\"/password: \"$password\"/" config.yaml

# 向start.sh脚本添加执行权限
RUN chmod +x start.sh

# 运行start.sh脚本
CMD ["./start.sh", "--listen", "0.0.0.0"]