FROM ubuntu:24.04

ARG INSTALL_DOCKER_CLI=true

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
    python3 \
    python3-pip \
    python3-venv \
    curl \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Docker CLI only (no daemon) — connects to DinD via DOCKER_HOST
RUN if [ "$INSTALL_DOCKER_CLI" = "true" ]; then \
    curl -fsSL https://get.docker.com | sh && \
    rm -rf /var/lib/apt/lists/*; \
    fi

WORKDIR /opt/ndslive-setup

# Install ndslive-setup from source
COPY . .
RUN pip install --break-system-packages -e ".[dev]"

# Default: keep container alive for exec-based scenario runs
CMD ["sleep", "infinity"]
