FROM python:3.11-slim

# Установка системных зависимостей
RUN apt-get update && apt-get install -y \
    ffmpeg \
    nodejs \
    npm \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Установка yt-dlp
RUN pip install --no-cache-dir yt-dlp

# Установка зависимостей Python
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Копирование кода приложения
COPY app/ /app/app/
WORKDIR /app

# Создание рабочей директории
RUN mkdir -p /data

# Запуск приложения
CMD ["python", "-m", "app.main"]
