FROM registry.yandex.net/ubuntu:xenial

RUN apt-get update && apt-get --assume-yes install iproute2
RUN apt-get update && apt-get --assume-yes install telnet
RUN apt-get update && apt-get --assume-yes install host tcpdump

ENV SAASPUSH_HOME=/saaspush
ENV TMP_DIR=$SAASPUSH_HOME/tmp
RUN mkdir $SAASPUSH_HOME
RUN mkdir $TMP_DIR

WORKDIR $SAASPUSH_HOME
# If link below doesn't work, then change it for the last from https://sandbox.yandex-team.ru/resources?author=alexbogo&type=SAAS_PUSH_CLIENT&limit=20&attrs={"released":"stable"}
# NOTE: You need to get a temporary link for downloading from sandbox
RUN wget https://proxy.sandbox.yandex-team.ru/resource/link/4926e70265a14eae9cc1ab1b507e3307?stream=tgz -O saaspush.tar.gz && tar -xvzf saaspush.tar.gz && rm saaspush.tar.gz
COPY config/saas_push.test.conf $TMP_DIR/
COPY config/saas_push.stable.conf $TMP_DIR/
COPY config/searchmap.test.json $TMP_DIR/
COPY start_app.sh $SAASPUSH_HOME

CMD ["./start_app.sh"]
