# Base image with bash, curl, and other utilities
FROM debian:bookworm-slim

# Install only essential dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    bash \
    curl \
    jq \
    python3 \
    python3-yaml \
    ca-certificates \
    dos2unix \
    && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

WORKDIR /workspace

COPY . .

# Convert Windows line endings to Unix and make scripts executable
RUN dos2unix *.sh *.py 2>/dev/null || true && chmod +x *.sh

SHELL ["/bin/bash", "-c"]

CMD ["bash", "run.sh", "values.yaml", "--insecure"]
