2026-05-20 14:18:55 -04:00
|
|
|
# GPU-accelerated worker — requires NVIDIA Container Toolkit on the host
|
|
|
|
|
# Build: docker compose -f docker-compose.yml -f docker-compose.gpu.yml build worker
|
|
|
|
|
#
|
|
|
|
|
# Prerequisites:
|
|
|
|
|
# - NVIDIA drivers installed on host
|
|
|
|
|
# - NVIDIA Container Toolkit: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/
|
|
|
|
|
# - GPU capability in docker-compose.gpu.yml enables NVENC access
|
|
|
|
|
|
|
|
|
|
FROM nvcr.io/nvidia/cuda:12.3.1-base-ubuntu22.04
|
|
|
|
|
|
2026-05-23 16:05:41 -04:00
|
|
|
# Install Node.js 20, ffmpeg (Ubuntu's ffmpeg includes h264_nvenc/hevc_nvenc),
|
2026-05-29 19:51:27 -04:00
|
|
|
# and yt-dlp for the YouTube importer.
|
|
|
|
|
#
|
|
|
|
|
# yt-dlp is NOT installed from apt: Ubuntu 22.04's package is pinned to a 2022
|
|
|
|
|
# release, which YouTube has long since broken (extraction fails). yt-dlp must
|
|
|
|
|
# track YouTube's frequent changes, so we pull the latest self-contained
|
|
|
|
|
# release binary at build time. /usr/local/bin precedes /usr/bin on PATH, so
|
|
|
|
|
# `yt-dlp` resolves to this one. Rebuild the worker image to refresh it.
|
2026-05-20 14:18:55 -04:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
2026-05-29 19:51:27 -04:00
|
|
|
curl ca-certificates ffmpeg python3 \
|
2026-05-20 14:18:55 -04:00
|
|
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
|
|
|
&& apt-get install -y --no-install-recommends nodejs \
|
2026-05-29 19:51:27 -04:00
|
|
|
&& curl -fsSL https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux \
|
|
|
|
|
-o /usr/local/bin/yt-dlp \
|
|
|
|
|
&& chmod a+rx /usr/local/bin/yt-dlp \
|
2026-05-20 14:18:55 -04:00
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY package*.json ./
|
2026-05-20 23:29:15 -04:00
|
|
|
RUN npm install --omit=dev
|
2026-05-20 14:18:55 -04:00
|
|
|
COPY src ./src
|
|
|
|
|
|
|
|
|
|
CMD ["node", "src/index.js"]
|