FROM python:3.9-slim

WORKDIR /app

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

# Create the m3u8 directory
RUN mkdir -p /m3u8 && chmod 777 /m3u8

COPY main.py .
COPY version .

EXPOSE 8000

CMD ["python", "main.py"]
