File size: 1,549 Bytes
a9df8b1
 
 
 
 
3191df5
 
a9df8b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# ── Stage 1: build frontend ──────────────────────────────────────────────────
FROM node:20-slim AS frontend-builder

WORKDIR /build/frontend
COPY skillwiki-frontend/package*.json ./
# Skip Puppeteer Chrome download (only needed for PDF scripts, not the app)
ENV PUPPETEER_SKIP_DOWNLOAD=true
RUN npm ci --prefer-offline

COPY skillwiki-frontend/ ./
# Disable WebSocket in the hosted build (HF Spaces doesn't support it)
ENV VITE_SKILLOS_DISABLE_WS=1
RUN npm run build

# ── Stage 2: runtime ─────────────────────────────────────────────────────────
FROM python:3.11-slim

WORKDIR /app

# Install slim Python deps (no heavy DB drivers)
COPY skillwiki/requirements-hf.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Install the skillwiki package
COPY skillwiki/ ./skillwiki/
RUN pip install --no-cache-dir -e ./skillwiki

# Copy built frontend
COPY --from=frontend-builder /build/frontend/dist ./frontend/dist

# HF Spaces runs as user 1000
RUN useradd -m -u 1000 skillwiki && chown -R skillwiki:skillwiki /app
USER 1000

# HF Spaces requires port 7860
EXPOSE 7860

ENV LLM_API_URL=https://api.deepseek.com
ENV LLM_MODEL=deepseek-chat
ENV SKILLWIKI_FRONTEND_DIST=/app/frontend/dist

CMD ["python", "-m", "skillwiki.api.main", "--host", "0.0.0.0", "--port", "7860", "--repository-backend", "memory"]