Spaces:
No application file
No application file
| # 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 | |
| # 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"] |