File size: 1,935 Bytes
a153994
 
 
35d2f85
a153994
 
5fbc2a6
 
a153994
 
 
35d2f85
a153994
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35d2f85
a153994
 
 
 
35d2f85
a153994
 
 
 
 
 
 
 
 
 
 
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
49
50
51
52
53
# 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 (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

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

# 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

# Define environment variables for configuration (these will be set at runtime)
# You can set defaults here, but it's better to pass them during `docker run`
ENV YOUTUBE_COOKIES_FILE_PATH="/app/cookies/youtube.txt"
ENV INSTAGRAM_COOKIES_FILE_PATH="/app/cookies/instagram.txt"
# The bot script will need to be updated to use these _FILE_PATH variables

# Command to run the application
# Replace bot.py with the actual name of your main Python script
CMD ["python", "bot.py"]