FROM node:18

# Install basic development tools
RUN apt update && apt install -y less git procps

# Install Kokoro JS dependencies if needed
RUN apt install -y build-essential python3

# Ensure default `node` user has access to `sudo`
ARG USERNAME=node
RUN apt-get install -y sudo \
    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
    && chmod 0440 /etc/sudoers.d/$USERNAME

# Set the default user
USER node

# Set working directory
WORKDIR /workspace