FROM debian

ADD . .

RUN apt -y update
RUN apt -y upgrade
RUN apt -y install apt-utils ca-certificates gnupg lsb-release

RUN apt-key adv --fetch-keys https://deb.nodesource.com/gpgkey/nodesource.gpg.key
RUN echo "deb https://deb.nodesource.com/node_15.x $(lsb_release -cs) main" >/etc/apt/sources.list.d/nodesource.list

RUN apt -y update
RUN apt -y install nginx nodejs

RUN cd url_shortener && npm install

CMD ["./docker.sh"]
