blfm commited on
Commit
cbbd8d1
·
verified ·
1 Parent(s): dc4007d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +57 -0
Dockerfile ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Set NODE_ENV to production
16
+ ENV NODE_ENV=production
17
+
18
+ # Install app dependencies
19
+ # COPY package*.json post-install.js ./
20
+ RUN git clone --depth 1 https://github.com/SillyTavern/SillyTavern -b 1.12.11 .
21
+ RUN git clone --depth 1 https://github.com/SillyTavern/SillyTavern-EdgeTTS-Plugin ./plugins/SillyTavern-EdgeTTS-Plugin
22
+ RUN \
23
+ echo "*** Install npm packages ***" && \
24
+ npm install && npm cache clean --force
25
+
26
+ # Bundle app source
27
+ # COPY . ./
28
+
29
+ ADD launch.sh launch.sh
30
+ COPY git-batch git-batch
31
+ RUN chmod +x launch.sh && chmod +x git-batch && ./git-batch -h
32
+
33
+ RUN \
34
+ echo "*** Install npm packages ***" && \
35
+ npm i --no-audit --no-fund --loglevel=error --no-progress --omit=dev && npm cache clean --force
36
+
37
+ # Copy default chats, characters and user avatars to <folder>.default folder
38
+ RUN \
39
+ rm -f "config.yaml" || true && \
40
+ ln -s "./config/config.yaml" "config.yaml" || true && \
41
+ mkdir "config" || true
42
+
43
+ # Cleanup unnecessary files
44
+ RUN \
45
+ echo "*** Cleanup ***" && \
46
+ mv "./docker/docker-entrypoint.sh" "./" && \
47
+ rm -rf "./docker" && \
48
+ echo "*** Make docker-entrypoint.sh executable ***" && \
49
+ chmod +x "./docker-entrypoint.sh" && \
50
+ echo "*** Convert line endings to Unix format ***" && \
51
+ dos2unix "./docker-entrypoint.sh"
52
+ RUN sed -i 's/# Start the server/.\/launch.sh env \&\& .\/launch.sh init/g' docker-entrypoint.sh
53
+ RUN chmod -R 777 ${APP_HOME}
54
+
55
+ EXPOSE 8000
56
+
57
+ CMD [ "./docker-entrypoint.sh" ]