kinaiok commited on
Commit
78ed4da
·
1 Parent(s): 244689a

fix: Use startup script to ensure correct working directory

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -3
  2. start.sh +3 -0
Dockerfile CHANGED
@@ -16,9 +16,11 @@ COPY package.json pnpm-lock.yaml ./
16
  COPY pnpm-workspace-hf.yaml ./pnpm-workspace.yaml
17
  COPY tsconfig.base.json tsconfig.json ./
18
 
19
- # 複製所有 packages
20
  COPY artifacts ./artifacts
21
  COPY lib ./lib
 
 
22
 
23
  # 安裝依賴
24
  RUN pnpm install --no-frozen-lockfile
@@ -59,5 +61,5 @@ RUN mkdir -p /data /app/temp-storage && \
59
  # 暴露 Hugging Face Spaces 預設端口
60
  EXPOSE 7860
61
 
62
- # 啟動命令
63
- CMD ["node", "--enable-source-maps", "artifacts/api-server/dist/index.mjs"]
 
16
  COPY pnpm-workspace-hf.yaml ./pnpm-workspace.yaml
17
  COPY tsconfig.base.json tsconfig.json ./
18
 
19
+ # 複製所有 packages 和啟動腳本
20
  COPY artifacts ./artifacts
21
  COPY lib ./lib
22
+ COPY start.sh ./start.sh
23
+ RUN chmod +x ./start.sh
24
 
25
  # 安裝依賴
26
  RUN pnpm install --no-frozen-lockfile
 
61
  # 暴露 Hugging Face Spaces 預設端口
62
  EXPOSE 7860
63
 
64
+ # 啟動命令(使用腳本確保從正確的目錄執行)
65
+ CMD ["./start.sh"]
start.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #!/bin/sh
2
+ cd /app
3
+ exec node --enable-source-maps artifacts/api-server/dist/index.mjs