FROM python:3.12.9-bullseye

COPY utils.py .

# extract packages from utils.py and pip install them. This saves a lot of running time
RUN BLOCK=$(awk '/BIG_CODE_BENCH_PACKAGE_MAPPING = {/,/}/' utils.py) && \
    PACKAGES=$(echo "$BLOCK" | grep -oP '"[^"]+":\s*"[^"]+"' | sed -E 's/.*:\s*"(.*)"/\1/') && \
    rm utils.py && \
    pip install $PACKAGES
