Bin29 commited on
Commit
06c0b5e
·
1 Parent(s): 23cdc61

Revert "fix(hf): use explicit startup script and align docker space config"

Browse files

This reverts commit 23cdc61b441bdfa08905965b02b96cc0bd72a574.

Files changed (3) hide show
  1. Dockerfile +4 -1
  2. README.md +5 -4
  3. start-with-redis-hf.cjs +9 -9
Dockerfile CHANGED
@@ -35,7 +35,10 @@ RUN npm install && npm --prefix frontend install
35
  COPY . .
36
  RUN npm run build
37
 
 
 
 
38
  ENV PORT=7860
39
  EXPOSE 7860
40
 
41
- CMD ["node", "start-with-redis-hf.cjs"]
 
35
  COPY . .
36
  RUN npm run build
37
 
38
+ # 7. 启动脚本
39
+ RUN printf '#!/bin/bash\nredis-server --daemonize yes\nnpm run start' > /app/start.sh && chmod +x /app/start.sh
40
+
41
  ENV PORT=7860
42
  EXPOSE 7860
43
 
44
+ CMD ["/app/start.sh"]
README.md CHANGED
@@ -3,10 +3,11 @@ title: ManimCat
3
  emoji: 🐱
4
  colorFrom: gray
5
  colorTo: blue
6
- sdk: docker
7
- app_port: 7860
8
- pinned: false
9
- ---
 
10
 
11
  <div align="center">
12
 
 
3
  emoji: 🐱
4
  colorFrom: gray
5
  colorTo: blue
6
+ sdk: docker
7
+ sdk_version: "3.10"
8
+ app_file: start-with-redis-hf.cjs
9
+ pinned: false
10
+ ---
11
 
12
  <div align="center">
13
 
start-with-redis-hf.cjs CHANGED
@@ -66,15 +66,15 @@ function startRedis() {
66
  })
67
  }
68
 
69
- function startNodeApp() {
70
- return new Promise((resolve, reject) => {
71
- console.log('Starting Node.js application...')
72
-
73
- const nodeApp = spawn('npm', ['run', 'start'], {
74
- stdio: 'inherit',
75
- env: {
76
- ...process.env,
77
- REDIS_HOST: 'localhost',
78
  REDIS_PORT: REDIS_PORT.toString()
79
  }
80
  })
 
66
  })
67
  }
68
 
69
+ function startNodeApp() {
70
+ return new Promise((resolve, reject) => {
71
+ console.log('Starting Node.js application...')
72
+
73
+ const nodeApp = spawn('node', ['dist/server.js'], {
74
+ stdio: 'inherit',
75
+ env: {
76
+ ...process.env,
77
+ REDIS_HOST: 'localhost',
78
  REDIS_PORT: REDIS_PORT.toString()
79
  }
80
  })