49 lines
1.6 KiB
Text
49 lines
1.6 KiB
Text
|
|
FROM python:3.12-slim
|
||
|
|
|
||
|
|
ARG TWITCH_DOWNLOADER_VERSION=1.56.4
|
||
|
|
ARG TARGETARCH
|
||
|
|
|
||
|
|
ENV PYTHONUNBUFFERED=1 \
|
||
|
|
PIP_NO_CACHE_DIR=1 \
|
||
|
|
RCLONE_CONFIG=/app/config/rclone.conf
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
RUN apt-get update \
|
||
|
|
&& apt-get install -y --no-install-recommends \
|
||
|
|
ca-certificates \
|
||
|
|
curl \
|
||
|
|
ffmpeg \
|
||
|
|
libicu-dev \
|
||
|
|
rclone \
|
||
|
|
unzip \
|
||
|
|
&& rm -rf /var/lib/apt/lists/*
|
||
|
|
|
||
|
|
RUN set -eux; \
|
||
|
|
case "${TARGETARCH}" in \
|
||
|
|
amd64) twitch_downloader_arch='Linux-x64' ;; \
|
||
|
|
arm64) twitch_downloader_arch='LinuxArm64' ;; \
|
||
|
|
arm) twitch_downloader_arch='LinuxArm' ;; \
|
||
|
|
*) echo "Unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; \
|
||
|
|
esac; \
|
||
|
|
curl -fsSL -o /tmp/TwitchDownloaderCLI.zip "https://github.com/lay295/TwitchDownloader/releases/download/${TWITCH_DOWNLOADER_VERSION}/TwitchDownloaderCLI-${TWITCH_DOWNLOADER_VERSION}-${twitch_downloader_arch}.zip"; \
|
||
|
|
mkdir -p /tmp/twitchdownloader; \
|
||
|
|
unzip -j /tmp/TwitchDownloaderCLI.zip TwitchDownloaderCLI -d /tmp/twitchdownloader; \
|
||
|
|
install -m 0755 /tmp/twitchdownloader/TwitchDownloaderCLI /usr/local/bin/TwitchDownloaderCLI; \
|
||
|
|
rm -rf /tmp/TwitchDownloaderCLI.zip /tmp/twitchdownloader
|
||
|
|
|
||
|
|
COPY requirements.txt ./requirements.txt
|
||
|
|
|
||
|
|
RUN python -m pip install --upgrade pip \
|
||
|
|
&& python -m pip install -r requirements.txt
|
||
|
|
|
||
|
|
COPY . /app
|
||
|
|
|
||
|
|
RUN mkdir -p /app/archive /app/config /app/bin/temp
|
||
|
|
|
||
|
|
COPY docker/entrypoint.sh /usr/local/bin/twitch-archive-entrypoint
|
||
|
|
|
||
|
|
RUN chmod +x /usr/local/bin/twitch-archive-entrypoint
|
||
|
|
|
||
|
|
ENTRYPOINT ["twitch-archive-entrypoint"]
|
||
|
|
CMD ["python", "twitch-archive.py", "-u", "vinesauce"]
|