FROM cincproject/workstation:24.4.1064

RUN adduser -u 1010 --disabled-password chef

# Run updates
RUN apt-get -y update \
  && apt-get -y upgrade \
  && apt-get install -y jsonlint \
  && apt-get -y clean \
  && rm -rf /var/lib/apt/lists/*

# Create symlink between jsonlint and jsonlint-php
RUN ln -s /usr/bin/jsonlint-php /usr/bin/jsonlint

# Run container as chef user
USER chef

# Configure git
RUN git config --global --add safe.directory /repository

RUN mkdir /home/chef/.cinc

COPY config.rb /home/chef/.cinc/config.rb

COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
