# Build context must be the repo root (docker compose sets this automatically)
FROM python:3.12-slim

WORKDIR /app

# Install dependencies first for layer caching
COPY webui/requirements.txt /app/webui/requirements.txt
RUN pip install --no-cache-dir -r /app/webui/requirements.txt

# Copy plugin sources required at runtime
COPY plugin.video.xstream /app/plugin.video.xstream
COPY script.module.xstreamscraper /app/script.module.xstreamscraper

# Copy the web UI itself
COPY webui /app/webui

WORKDIR /app/webui

EXPOSE 5000

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