Spaces:
Running
Running
Upload Dockerfile
Browse files- Dockerfile +76 -0
Dockerfile
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:19.1.0-alpine3.16
|
2 |
+
|
3 |
+
# Arguments
|
4 |
+
ARG APP_HOME=/home/node/app
|
5 |
+
|
6 |
+
# Install system dependencies
|
7 |
+
RUN apk add gcompat tini git jq curl
|
8 |
+
|
9 |
+
# Ensure proper handling of kernel signals
|
10 |
+
ENTRYPOINT [ "tini", "--" ]
|
11 |
+
|
12 |
+
# Create app directory
|
13 |
+
WORKDIR ${APP_HOME}
|
14 |
+
|
15 |
+
# Env
|
16 |
+
# 是否远程获取下面的参数 是个链接,返回一个json;执行完后关闭这个链接即可保密
|
17 |
+
# 返回内容:
|
18 |
+
# {
|
19 |
+
# "reverse_proxy": "https://onekey.xxx.top/v1",
|
20 |
+
# "proxy_password": "sk-ssvJn4VQAk596Lvv3548xxx",
|
21 |
+
# "api_key_makersuite": "AIzaSyAm5S9kl22DDNSXmnd4vgxxx",
|
22 |
+
# "github_secret": "github_pat_11AIWDQ2A0cLSEdwiwiZNC_10II4TsFExxx",
|
23 |
+
# "github_project": "bincooo/history"
|
24 |
+
# }
|
25 |
+
ENV fetch ""
|
26 |
+
# 代理转发地址
|
27 |
+
ENV reverse_proxy ""
|
28 |
+
# 代理转发token
|
29 |
+
ENV proxy_password ""
|
30 |
+
# gemini token
|
31 |
+
ENV api_key_makersuite ""
|
32 |
+
# github 项目访问凭证token
|
33 |
+
ENV github_secret ""
|
34 |
+
# github 项目名称
|
35 |
+
ENV github_project ""
|
36 |
+
|
37 |
+
# Install app dependencies
|
38 |
+
# COPY package*.json post-install.js ./
|
39 |
+
RUN git clone https://github.com/SillyTavern/SillyTavern.git --branch 1.12.1 .
|
40 |
+
RUN \
|
41 |
+
echo "*** Install npm packages ***" && \
|
42 |
+
npm install && npm cache clean --force
|
43 |
+
|
44 |
+
# Bundle app source
|
45 |
+
# COPY . ./
|
46 |
+
|
47 |
+
ADD launch.sh launch.sh
|
48 |
+
RUN curl -JLO https://github.com/bincooo/SillyTavern-Docker/releases/download/v1.0.0/git-batch
|
49 |
+
RUN chmod +x launch.sh && chmod +x git-batch && ./git-batch -h
|
50 |
+
|
51 |
+
ADD ["user-default.png", "data/default-user/User Avatars/user-default.png"]
|
52 |
+
ADD ["OpenAI Settings", "data/default-user/OpenAI Settings"]
|
53 |
+
ADD ["QuickReplies", "data/default-user/QuickReplies"]
|
54 |
+
ADD secrets.json secrets.json
|
55 |
+
# 启动设置
|
56 |
+
ADD config.yaml config/config.yaml
|
57 |
+
# 服务设置
|
58 |
+
ADD settings.json config/settings.json
|
59 |
+
# 导入角色卡
|
60 |
+
ADD characters data/default-user/characters
|
61 |
+
|
62 |
+
# Cleanup unnecessary files
|
63 |
+
RUN \
|
64 |
+
echo "*** Cleanup ***" && \
|
65 |
+
mv "./docker/docker-entrypoint.sh" "./" && \
|
66 |
+
rm -rf "./docker" && \
|
67 |
+
echo "*** Make docker-entrypoint.sh executable ***" && \
|
68 |
+
chmod +x "./docker-entrypoint.sh" && \
|
69 |
+
echo "*** Convert line endings to Unix format ***" && \
|
70 |
+
dos2unix "./docker-entrypoint.sh"
|
71 |
+
RUN sed -i 's/# Start the server/.\/launch.sh env \&\& .\/launch.sh init/g' docker-entrypoint.sh
|
72 |
+
RUN chmod -R 777 ${APP_HOME}
|
73 |
+
|
74 |
+
EXPOSE 8000
|
75 |
+
|
76 |
+
CMD [ "./docker-entrypoint.sh" ]
|