Spaces:
Running
Running
fix: three startup errors from build/runtime
Browse files- Remove HfFolder import (removed in huggingface_hub >= 0.20)
- Build only ui + server packages (match official Paperclip Dockerfile)
- Launch server with tsx loader so workspace .ts packages resolve at runtime
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Dockerfile +3 -2
- paperclip-sync.py +1 -1
- start.sh +2 -2
Dockerfile
CHANGED
|
@@ -16,8 +16,9 @@ RUN npm install -g pnpm
|
|
| 16 |
# Install dependencies
|
| 17 |
RUN pnpm install
|
| 18 |
|
| 19 |
-
# Build Paperclip
|
| 20 |
-
RUN pnpm build
|
|
|
|
| 21 |
|
| 22 |
# Stage 2: Runtime
|
| 23 |
FROM node:lts-trixie-slim
|
|
|
|
| 16 |
# Install dependencies
|
| 17 |
RUN pnpm install
|
| 18 |
|
| 19 |
+
# Build Paperclip (match official Dockerfile: ui + server only, tsx handles db at runtime)
|
| 20 |
+
RUN pnpm --filter @paperclipai/ui build
|
| 21 |
+
RUN pnpm --filter @paperclipai/server build
|
| 22 |
|
| 23 |
# Stage 2: Runtime
|
| 24 |
FROM node:lts-trixie-slim
|
paperclip-sync.py
CHANGED
|
@@ -14,7 +14,7 @@ import logging
|
|
| 14 |
from datetime import datetime
|
| 15 |
from pathlib import Path
|
| 16 |
|
| 17 |
-
from huggingface_hub import HfApi
|
| 18 |
from huggingface_hub.utils import RepositoryNotFoundError
|
| 19 |
|
| 20 |
# ============================================================================
|
|
|
|
| 14 |
from datetime import datetime
|
| 15 |
from pathlib import Path
|
| 16 |
|
| 17 |
+
from huggingface_hub import HfApi
|
| 18 |
from huggingface_hub.utils import RepositoryNotFoundError
|
| 19 |
|
| 20 |
# ============================================================================
|
start.sh
CHANGED
|
@@ -232,5 +232,5 @@ cleanup() {
|
|
| 232 |
|
| 233 |
trap cleanup SIGTERM SIGINT
|
| 234 |
|
| 235 |
-
# Start Paperclip server (
|
| 236 |
-
exec
|
|
|
|
| 232 |
|
| 233 |
trap cleanup SIGTERM SIGINT
|
| 234 |
|
| 235 |
+
# Start Paperclip server with tsx loader (loads workspace .ts packages at runtime)
|
| 236 |
+
exec node --import ./server/node_modules/tsx/dist/loader.mjs server/dist/index.js
|