FROM registry.yandex.net/ubuntu:bionic


RUN apt-get update && apt-get install cron locales -y

COPY build/crypta/audience/bin/crypta-audience /root/crypta-audience
COPY entrypoint.sh /root/entrypoint.sh
COPY audience-tasks /etc/cron.d/audience-tasks
# hack to make cron work in container (https://stackoverflow.com/questions/21926465/issues-running-cron-in-docker-on-different-hosts)
RUN sed -i "/pam_loginuid.so/s/^/#/g" /etc/pam.d/cron
RUN sed -i "/pam_limits.so/s/^/#/g" /etc/pam.d/cron
RUN chmod 0600 /etc/cron.d/audience-tasks
RUN locale-gen en_US.utf8
RUN update-locale

CMD ["bash", "/root/entrypoint.sh"]
