FROM debian

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y && apt-get install -y gnupg2 apt-transport-https ca-certificates && apt-get clean

RUN echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | tee /etc/apt/sources.list.d/100-ubnt-unifi.list

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50 

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

RUN  echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" >> /etc/apt/sources.list.d/mongo.list

RUN apt-get update -y && apt-get install -y unifi && apt-get clean

CMD java $JVM_OPTS -jar /usr/lib/unifi/lib/ace.jar start