FROM registry.yandex.net/ubuntu:trusty
RUN apt-get update
RUN apt-get install --reinstall -y locales

RUN locale-gen en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US
ENV LC_ALL en_US.UTF-8
RUN dpkg-reconfigure --frontend noninteractive locales
RUN apt-get install -y yandex-jdk8  supervisor nginx && rm -rf /var/lib/apt/lists/*
ADD conf/nginx/nginx.conf /etc/nginx/nginx.conf
ADD conf/supervisor/nginx.conf /etc/supervisor/conf.d/nginx.conf
ADD conf/supervisor/prepare.conf /etc/supervisor/conf.d/prepare.conf
ADD conf/supervisor/timeline-api.conf /etc/supervisor/conf.d/timeline-api.conf
ADD conf/supervisor/timeline-tms.conf /etc/supervisor/conf.d/timeline-tms.conf
ADD conf/supervisor/timeline-ui.conf /etc/supervisor/conf.d/timeline-ui.conf
ADD conf/supervisor/supervisor.conf /etc/supervisor.conf
ADD prepare.sh ./
EXPOSE 80
ENTRYPOINT ["supervisord", "-c", "/etc/supervisor.conf"]
