FROM denoland/deno:debian AS frontend-builder
WORKDIR /build/src/arr_mcp/dashboard/frontend
COPY src/arr_mcp/dashboard/frontend/ ./
RUN deno task build

FROM python:3.12-slim

LABEL org.opencontainers.image.title="arr-mcp"
LABEL org.opencontainers.image.description="MCP server for home media stack management"
LABEL org.opencontainers.image.licenses="MIT"

WORKDIR /app

COPY pyproject.toml README.md ./
COPY src/ ./src/
COPY --from=frontend-builder /build/src/arr_mcp/dashboard/static/dist/ ./src/arr_mcp/dashboard/static/dist/

RUN pip install --no-cache-dir .

EXPOSE 8081

ENV ARR_MCP_LOG_LEVEL=info

CMD ["arr-mcp"]
