st / Dockerfile
fuliai's picture
Update Dockerfile
6c172aa verified
raw
history blame contribute delete
No virus
804 Bytes
# 使用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"]