FROM alpine:latest
LABEL maintainer="Nnanahira <nanahira@momobako.com>"

ARG TIMEZONE=Asia/Shanghai

RUN apk add --no-cache tzdata curl wget && \
  cp -rf /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \
  echo "$TIMEZONE" > /etc/timezone && \
  curl -L --insecure https://github.com/odise/go-cron/releases/download/v0.0.7/go-cron-linux.gz | zcat > /usr/local/bin/go-cron && \
  chmod u+x /usr/local/bin/go-cron && \
  rm -rf /var/log/* /tmp/* /var/tmp/*

ENV SCHEDULE="0 0 4 * * *"
COPY ./entrypoint.sh /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]
