FROM python:3.12-slim

WORKDIR /workspace

# Keep the image small and avoid pip cache leftovers.
RUN python -m pip install --upgrade --no-cache-dir pip

# Install whichever wheel is mounted/copied into /tmp/wheel.
# The script binds the wheel directory read-only and selects one .whl.
ENTRYPOINT ["/bin/bash", "-lc", "set -euo pipefail; WHEEL_PATH=\"${WHEEL_PATH:-}\"; if [ -z \"$WHEEL_PATH\" ]; then WHEEL_PATH=\"$(ls /tmp/wheel/*.whl 2>/dev/null | head -n 1 || true)\"; fi; if [ -z \"$WHEEL_PATH\" ] || [ ! -f \"$WHEEL_PATH\" ]; then echo \"No wheel found. Set WHEEL_PATH or mount a .whl under /tmp/wheel.\"; exit 1; fi; python -m pip install --no-cache-dir \"$WHEEL_PATH\"; exec /bin/bash"]
