FROM python:3.11-slim

RUN apt update && apt install -y curl ffmpeg && \
    curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \
    chmod a+rx /usr/local/bin/yt-dlp

WORKDIR /app
COPY . .

RUN pip install --no-cache-dir -r requirements.txt

ENV MUSIC_DIR=/music

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
