# Usa una imagen base ligera de Alpine Linux
FROM alpine:latest

# Instala las dependencias necesarias
RUN apk --update add \
    bash \
    curl \
    unzip

# Instala Terraform
RUN curl -O https://releases.hashicorp.com/terraform/0.14.0/terraform_0.14.0_linux_amd64.zip \
    && unzip terraform_0.14.0_linux_amd64.zip \
    && mv terraform /usr/local/bin/ \
    && rm terraform_0.14.0_linux_amd64.zip

# Instala TFLint
RUN curl -L https://github.com/terraform-linters/tflint/releases/latest/download/tflint_linux_amd64.zip -o tflint.zip \
    && unzip tflint.zip \
    && mv tflint /usr/local/bin/ \
    && rm tflint.zip

# Instala TFSec
RUN curl -L https://github.com/liamg/tfsec/releases/latest/download/tfsec-linux-amd64 -o tfsec \
    && chmod +x tfsec \
    && mv tfsec /usr/local/bin/

# Instala AWS CLI
RUN apk --no-cache add \
    python3 \
    py3-pip \
    && pip3 install --upgrade pip \
    && pip3 install awscli

# Establece el directorio de trabajo
WORKDIR /workspace

# Comando predeterminado al iniciar el contenedor
CMD ["bash"]
