CoolFace
Apppublic

alice0321/nyx

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
Dockerfile70 linesDownload Raw Back to root
1FROM node:19.1.0-alpine3.162 3# 设置应用目录4ARG APP_HOME=/home/node/app5 6# 安装系统依赖7RUN apk add --no-cache gcompat tini git python3 py3-pip bash dos2unix findutils tar curl8 9# 安装HuggingFace Hub10RUN pip3 install --no-cache-dir huggingface_hub11 12# 确保正确处理内核信号13ENTRYPOINT [ "tini", "--" ]14 15# 创建应用目录16WORKDIR ${APP_HOME}17 18# 设置NODE_ENV为production19ENV NODE_ENV=production20 21# 设置登录凭证环境变量22ENV USERNAME="admin"23ENV PASSWORD="password"24 25# 克隆官方SillyTavern仓库(最新版本)26RUN git clone https://github.com/SillyTavern/SillyTavern.git .27 28# 安装依赖29RUN echo "*** 安装npm包 ***" && \30    npm install && npm cache clean --force31 32# 添加启动脚本和数据同步脚本33COPY launch.sh sync_data.sh ./34RUN chmod +x launch.sh sync_data.sh && \35    dos2unix launch.sh sync_data.sh36 37# 安装生产依赖38RUN echo "*** 安装生产npm包 ***" && \39    npm i --no-audit --no-fund --loglevel=error --no-progress --omit=dev && npm cache clean --force40 41# 创建配置目录42RUN mkdir -p "config" || true && \43    rm -f "config.yaml" || true && \44    ln -s "./config/config.yaml" "config.yaml" || true45 46# 清理不必要的文件47RUN echo "*** 清理 ***" && \48    mv "./docker/docker-entrypoint.sh" "./" && \49    rm -rf "./docker" && \50    echo "*** 使docker-entrypoint.sh可执行 ***" && \51    chmod +x "./docker-entrypoint.sh" && \52    echo "*** 转换行尾为Unix格式 ***" && \53    dos2unix "./docker-entrypoint.sh" || true54 55# 修改入口脚本,添加自定义启动脚本56RUN sed -i 's/# Start the server/.\/launch.sh/g' docker-entrypoint.sh57 58# 创建临时备份目录和数据目录59RUN mkdir -p /tmp/sillytavern_backup && \60    mkdir -p ${APP_HOME}/data61 62# 设置权限63RUN chmod -R 777 ${APP_HOME} && \64    chmod -R 777 /tmp/sillytavern_backup65 66# 暴露端口67EXPOSE 800068 69# 启动命令70CMD [ "./docker-entrypoint.sh" ]