46 lines
1.8 KiB
Docker
46 lines
1.8 KiB
Docker
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
|
|
|
|
# Set noninteractive mode to avoid tzdata and other interactive prompts
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Install prerequisites for adding repositories
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
software-properties-common \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Add deadsnakes PPA for Python 3.9
|
|
RUN add-apt-repository ppa:deadsnakes/ppa -y
|
|
|
|
# Install Python 3.9, python3.9-distutils, pip, and other dependencies
|
|
RUN apt-get update && \
|
|
apt-get install -y python3.9 python3.9-distutils python3-pip ffmpeg jq curl unzip && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set python3.9 as the default python3 and upgrade pip
|
|
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \
|
|
pip3 install --no-cache-dir --upgrade pip
|
|
|
|
# Set the working directory
|
|
WORKDIR /app
|
|
|
|
# Copy requirements file and install Python dependencies
|
|
# (Ensure your requirements.txt includes the correct CUDA-enabled PyTorch version,
|
|
# for example: torch==1.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html)
|
|
COPY requirements.txt .
|
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
# Download and install TwitchDownloaderCLI (adjust version if necessary)
|
|
RUN curl -L https://github.com/lay295/TwitchDownloader/releases/download/1.55.2/TwitchDownloaderCLI-1.55.2-Linux-x64.zip \
|
|
-o /tmp/TwitchDownloaderCLI.zip && \
|
|
unzip /tmp/TwitchDownloaderCLI.zip -d /tmp && \
|
|
mv /tmp/TwitchDownloaderCLI /usr/local/bin/TwitchDownloaderCLI && \
|
|
chmod +x /usr/local/bin/TwitchDownloaderCLI && \
|
|
rm /tmp/TwitchDownloaderCLI.zip
|
|
|
|
# Copy application code and other necessary files
|
|
COPY main.py .
|
|
COPY channels.json .
|
|
COPY cookies.txt .
|
|
|
|
# Default command to run your application
|
|
CMD ["python3", "-u", "main.py"] |