- Kaniko: --cache-ttl=168h, --snapshot-mode=redo, --compressed-caching=false - Dockerfile: Split server-build into server-deps + server-build for better layer caching - Replace rm+reinstall node_modules with npm prune --omit=dev - Move ffmpeg/yt-dlp install to tools/install-tools.sh (single RUN layer) - Remove separate ffmpeg-fetch stage and inline curl/yt-dlp install - Remove $CI_COMMIT_SHA tag destination (unused, saves push time) - bump-version: alpine/git image instead of alpine + apk add git Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
1 KiB
Bash
26 lines
1 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
echo "[install-tools] Installing ffmpeg + yt-dlp..."
|
|
|
|
apt-get update && apt-get install -y --no-install-recommends curl ca-certificates xz-utils \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# FFmpeg (static build from yt-dlp project)
|
|
curl -L https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz \
|
|
-o /tmp/ffmpeg.tar.xz
|
|
mkdir -p /tmp/ffmpeg
|
|
tar -xJf /tmp/ffmpeg.tar.xz -C /tmp/ffmpeg --strip-components=2 --wildcards "*/bin/ffmpeg"
|
|
mv /tmp/ffmpeg/ffmpeg /usr/local/bin/ffmpeg
|
|
chmod +x /usr/local/bin/ffmpeg
|
|
rm -rf /tmp/ffmpeg /tmp/ffmpeg.tar.xz
|
|
|
|
# yt-dlp (standalone linux binary, no Python needed)
|
|
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux \
|
|
-o /usr/local/bin/yt-dlp
|
|
chmod +x /usr/local/bin/yt-dlp
|
|
|
|
# Cleanup curl/xz (keep ca-certificates for HTTPS)
|
|
apt-get purge -y curl xz-utils && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
|
|
|
|
echo "[install-tools] Done. ffmpeg=$(ffmpeg -version 2>&1 | head -1), yt-dlp=$(yt-dlp --version 2>/dev/null || echo 'ok')"
|