ARG BASE_IMAGE
FROM ${BASE_IMAGE} as base

COPY ./images/php/cron/conf.d/psc /etc/cron.d/
COPY ./images/php/cron/bin/ /usr/bin/
RUN chmod +x /usr/bin/start-cron.sh
RUN chmod +x /usr/bin/set-env.sh

RUN apt-get update && apt-get install -y cron rsyslog
RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf

FROM base as prod

USER $APP_USER_NAME

FROM base as ci

USER $APP_USER_NAME

FROM base as local

CMD ["/usr/bin/set-env.sh"]
