File size: 1,860 Bytes
fe4ade5
 
 
4da78e6
fe4ade5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0fc6d65
 
 
 
 
fe4ade5
 
4da78e6
 
fe4ade5
 
4da78e6
fe4ade5
 
 
 
4da78e6
fe4ade5
 
 
4da78e6
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Dockerfile

# Use an official Python runtime as a parent image
FROM python:3.12-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Install system dependencies
# - ffmpeg is crucial for yt-dlp for merging formats and segment downloads
# - git is sometimes needed by yt-dlp for updates or certain extractors (optional but good to have)
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    ffmpeg \
    git \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
# RUN pip install --no-cache-dir -r requirements.txt
# RUN python -m pip install --upgrade "pip>=26.2.2" \
#     && pip install --no-cache-dir -r requirements.txt
RUN python -m pip install "pip @ https://files.pythonhosted.org/packages/3f/06/3e4420302363fbb71be3c7f35ce042f54bfca330e3e66b3a2e3c4cca579f/pip-26.2.2-py3-none-any.whl#sha256=fd7f4dfa8190e014013b9f08f3e973f4e4c26ffd179a204895533a7254813a70" \
     && pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application's code into the container at /app
# This assumes the bot script is named bot.py and is in the same directory as the Dockerfile
# Adjust if the main script has a different name or is in a subdirectory.
COPY . .

# Expose a volume for downloads (but good for persisting data)
# The bot script currently uses "video_downloads/" relative to its execution path.
# So, /app/video_downloads/ will be the path inside the container.
VOLUME /app/video_downloads

# Expose a volume for cookies (for easier management)
VOLUME /app/cookies

# Command to run the application
# CMD ["python", "bot_subprocess.py"]
CMD ["python", "bot_telethon.py"]