FROM devopsinfra/docker-terragrunt:tf-1.6.4-tg-0.53.5

WORKDIR /project/app

ARG ABSOLUTE_PATH
ENV ABSOLUTE_PATH=${ABSOLUTE_PATH}

# Packages
RUN apt-get update && apt-get install -y npm curl
RUN npm i -g esbuild@0.19.5

# Install nodejs20
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt remove -y libnode-dev && apt-get install -y nodejs

# SSH key for NPM deps
RUN mkdir ~/.ssh
RUN echo -e "Host *\nStrictHostKeyChecking no\nUserKnownHostsFile=/dev/null\nForwardAgent yes"  >> ~/.ssh/config
ARG SSH_KEY
RUN echo "$SSH_KEY" > /root/.ssh/id_rsa
RUN chmod 0600 ~/.ssh/id_rsa && ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub

ENTRYPOINT /project/app/entrypoint-dev.sh

