File size: 2,002 Bytes
854edba
 
 
 
 
 
250ca15
854edba
81485b9
 
854edba
 
 
 
 
 
 
81485b9
 
 
 
854edba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6743e16
 
854edba
 
 
 
 
81485b9
 
250ca15
6743e16
81485b9
 
 
 
 
 
854edba
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM node:22-bookworm

ENV NODE_ENV=production \
    PORT=7860 \
    HOST=0.0.0.0 \
    WORKSPACE_ROOT=/tmp/hyperframes-work \
    HOME=/app \
    PRODUCER_FORCE_SCREENSHOT=true \
    PUPPETEER_CACHE_DIR=/app/.cache/puppeteer \
    HYPERFRAMES_WHISPER_PATH=/opt/whisper.cpp/build/bin/whisper-cli

WORKDIR /app

# HyperFrames needs FFmpeg/FFprobe and Chromium runtime libraries.
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    ca-certificates \
    git \
    cmake \
    build-essential \
    curl \
    fonts-liberation \
    libasound2 \
    libatk-bridge2.0-0 \
    libatk1.0-0 \
    libcups2 \
    libdbus-1-3 \
    libdrm2 \
    libgbm1 \
    libgtk-3-0 \
    libnspr4 \
    libnss3 \
    libx11-xcb1 \
    libxcomposite1 \
    libxdamage1 \
    libxfixes3 \
    libxkbcommon0 \
    libxrandr2 \
    xdg-utils \
    python3 \
    python3-pip \
 && rm -rf /var/lib/apt/lists/*

COPY package.json package-lock.json* ./
RUN npm install --omit=dev

# Pre-cache Chrome, TTS dependencies, and whisper.cpp for HyperFrames rendering/media.
RUN mkdir -p /app/.cache/puppeteer /app/.cache/hyperframes/whisper/models \
 && npx puppeteer browsers install chrome-headless-shell \
 && npx hyperframes browser ensure \
 && python3 -m pip install --break-system-packages --no-cache-dir kokoro-onnx soundfile \
 && git clone --depth 1 https://github.com/ggml-org/whisper.cpp.git /opt/whisper.cpp \
 && cmake -S /opt/whisper.cpp -B /opt/whisper.cpp/build -DGGML_NATIVE=OFF -DWHISPER_BUILD_TESTS=OFF -DWHISPER_BUILD_EXAMPLES=ON \
 && cmake --build /opt/whisper.cpp/build --config Release -j2 \
 && test -x /opt/whisper.cpp/build/bin/whisper-cli \
 && curl -L --fail --retry 3 -o /app/.cache/hyperframes/whisper/models/ggml-tiny.en.bin https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en.bin

COPY server.mjs ./server.mjs
RUN mkdir -p /tmp/hyperframes-work /app/.cache/puppeteer && chmod -R 777 /tmp/hyperframes-work /app/.cache

EXPOSE 7860
CMD ["npm", "start"]