周泳恩 commited on
Commit
cb08e60
·
1 Parent(s): 0ec4b83

恢复原始Dockerfile并删除不必要的app.py

Browse files
Files changed (2) hide show
  1. Dockerfile +38 -0
  2. app.py +0 -5
Dockerfile CHANGED
@@ -11,3 +11,41 @@ WORKDIR ${APP_HOME}
11
 
12
  # Set NODE_ENV to production
13
  ENV NODE_ENV=production
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  # Set NODE_ENV to production
13
  ENV NODE_ENV=production
14
+
15
+ # Install app dependencies
16
+ COPY package*.json post-install.js ./
17
+ RUN \
18
+ echo "*** Install npm packages ***" && \
19
+ npm i --no-audit --no-fund --loglevel=error --no-progress --omit=dev && npm cache clean --force
20
+
21
+ # Bundle app source
22
+ COPY . ./
23
+
24
+ # Copy default chats, characters and user avatars to <folder>.default folder
25
+ RUN \
26
+ rm -f "config.yaml" || true && \
27
+ ln -s "./config/config.yaml" "config.yaml" || true && \
28
+ mkdir "config" || true
29
+
30
+ # Pre-compile public libraries
31
+ RUN \
32
+ echo "*** Run Webpack ***" && \
33
+ node "./docker/build-lib.js"
34
+
35
+ # Cleanup unnecessary files
36
+ RUN \
37
+ echo "*** Cleanup ***" && \
38
+ mv "./docker/docker-entrypoint.sh" "./" && \
39
+ rm -rf "./docker" && \
40
+ echo "*** Make docker-entrypoint.sh executable ***" && \
41
+ chmod +x "./docker-entrypoint.sh" && \
42
+ echo "*** Convert line endings to Unix format ***" && \
43
+ dos2unix "./docker-entrypoint.sh"
44
+
45
+ # Fix extension repos permissions
46
+ RUN git config --global --add safe.directory "*"
47
+
48
+ EXPOSE 8000
49
+
50
+ # Ensure proper handling of kernel signals
51
+ ENTRYPOINT ["tini", "--", "./docker-entrypoint.sh"]
app.py DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- # 这是一个占位文件,实际应用通过Dockerfile启动
4
- # This is a placeholder file, the actual application is started through Dockerfile
5
- print("SillyTavern应用通过Docker启动")