Add StartOS 0.4.0 packaging

This commit is contained in:
MacPro
2026-04-09 15:03:31 -05:00
commit 68ec875ee7
2057 changed files with 490924 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
# ─────────────────────────────────────────────────────────
# YouTube Summarizer — StartOS 0.4 Docker image
#
# Multi-stage build for ARM64 (Raspberry Pi / Start9 server)
# Includes: Node.js 20, Python 3, yt-dlp, ffmpeg
#
# Uses Debian slim (not Alpine) because:
# - yt-dlp's --impersonate chrome requires curl_cffi (compiled C extension)
# - curl_cffi's prebuilt wheels target glibc, not musl
# - Debian is more reliable for pip-installed packages with C deps on ARM64
# ─────────────────────────────────────────────────────────
# ── Stage 1: Install Node.js dependencies ──────────────────
FROM node:20-slim AS builder
WORKDIR /app/server
COPY server/package.json server/package-lock.json* ./
RUN npm ci --production --ignore-scripts 2>/dev/null || npm install --production --ignore-scripts
# ── Stage 2: Final runtime image ───────────────────────────
FROM node:20-slim AS runner
WORKDIR /app
# Install runtime dependencies:
# - dumb-init: proper PID 1 signal handling in containers
# - curl: health checks + yt-dlp binary downloads
# - python3 + pip: yt-dlp installation and updates
# - ffmpeg: audio extraction, splitting, and duration detection
# - ca-certificates: HTTPS for YouTube/Gemini API calls
RUN apt-get update && apt-get install -y --no-install-recommends \
dumb-init \
curl \
python3 \
python3-pip \
python3-venv \
ffmpeg \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install --break-system-packages yt-dlp curl_cffi \
&& yt-dlp --version
# Copy Node.js app from builder
COPY --from=builder /app/server/node_modules ./server/node_modules/
COPY server/package.json ./server/
COPY server/index.js ./server/
COPY public/ ./public/
COPY assets/ ./assets/
# Copy StartOS scripts
COPY start9/0.4/docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
COPY start9/0.4/healthcheck.sh /usr/local/bin/healthcheck.sh
RUN chmod +x /usr/local/bin/docker_entrypoint.sh /usr/local/bin/healthcheck.sh
# Create persistent data mount point
RUN mkdir -p /data
ENV NODE_ENV=production \
PORT=3001 \
DATA_DIR=/data
EXPOSE 3001
ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/docker_entrypoint.sh"]