# Custom Docker image for Woodpecker CI
# Pre-installs common tools to speed up CI runs
#
# Build: docker build -t your-registry/ci:latest -f .woodpecker/Dockerfile .
# Push: docker push your-registry/ci:latest
#
# Then update .woodpecker/ci.yml to use: image: your-registry/ci:latest

FROM rust:latest

# Install system dependencies
RUN apt-get update && apt-get install -y \
    shellcheck \
    curl \
    git \
    && rm -rf /var/lib/apt/lists/*

# Install just
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin

# Install Rust components
RUN rustup component add clippy rustfmt

# Install Rust tools (pre-compiled to speed up CI)
RUN cargo install \
    cargo-audit \
    cargo-deny \
    cargo-sbom \
    nickel-lang-cli \
    nu \
    --locked

# Set working directory
WORKDIR /workspace

# Verify installations
RUN just --version && \
    cargo --version && \
    cargo audit --version && \
    cargo deny --version && \
    cargo sbom --version && \
    nickel --version && \
    nu --version

CMD ["/bin/bash"]
