FROM python:3.12

RUN sed -i 's@deb.debian.org@ftp.kaist.ac.kr@g' /etc/apt/sources.list.d/debian.sources

# Setup Crontab

RUN apt update && apt -y install cron

COPY crontab /etc/cron.d/crontab
RUN chmod 0644 /etc/cron.d/crontab
RUN /usr/bin/crontab /etc/cron.d/crontab

# Setup Environment Variables

RUN export $(cat .env | xargs)

# Setup Python Environment
WORKDIR /app

RUN pip config set global.break-system-packages true
RUN pip install -r requirements.txt

RUN rm -rf /etc/localtime
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime

CMD ["cron", "-f"]