FROM alpine:3.21

ARG TOFU_VERSION=1.11.0

RUN apk add --no-cache \
      ansible \
      bash \
      bind-tools \
      ca-certificates \
      curl \
      git \
      jq \
      openssh-client \
      openssl \
      python3 \
      py3-pip \
      sshpass \
      unzip

RUN curl -sfL -o /tmp/tofu.zip \
      "https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_linux_amd64.zip" \
 && unzip -q /tmp/tofu.zip -d /tmp/tofu \
 && install /tmp/tofu/tofu /usr/local/bin/tofu \
 && rm -rf /tmp/tofu /tmp/tofu.zip

RUN pip3 install --break-system-packages --no-cache-dir \
      proxmoxer \
      requests

RUN ansible-galaxy collection install \
      community.proxmox \
      community.docker
