Platon on Cloud

DigitalOcean App Platform Job Scheduler

Shorts

Dockerfile

FROM python:3.11

WORKDIR /code

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

COPY crontab ./crontab
RUN crontab ./crontab

COPY . /code

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

crontab

SHELL=/bin/bash

0 0 * * * /usr/local/bin/python /code/cli.py > /proc/1/fd/1 2>&1

entrypoint.sh

#!/bin/bash

printenv | grep -v "no_proxy" >> /etc/environment

cron -f -L 2
comments powered by Disqus