2023-11-22 04:02:10 +00:00
|
|
|
FROM python:3.12.0-slim
|
2021-12-12 01:05:23 +00:00
|
|
|
|
2023-11-22 04:02:10 +00:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y gcc musl-dev libffi-dev libssl-dev ca-certificates cron \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2023-11-18 10:37:51 +00:00
|
|
|
|
2023-11-22 04:02:10 +00:00
|
|
|
RUN pip install --no-cache-dir pdm
|
2021-12-12 01:05:23 +00:00
|
|
|
|
2023-11-18 10:37:51 +00:00
|
|
|
COPY ./utils /srv/utils/
|
2021-12-12 01:05:23 +00:00
|
|
|
|
2023-11-13 13:18:59 +00:00
|
|
|
COPY ./miuitask.py /srv/
|
|
|
|
|
2023-11-18 10:37:51 +00:00
|
|
|
COPY pyproject.toml pdm.lock /srv/
|
2021-12-12 01:05:23 +00:00
|
|
|
|
2023-11-18 10:37:51 +00:00
|
|
|
WORKDIR /srv
|
|
|
|
|
2023-11-22 04:02:10 +00:00
|
|
|
RUN pip install --no-cache-dir urllib3 certifi
|
2023-11-18 10:37:51 +00:00
|
|
|
|
|
|
|
RUN pdm install --prod && \
|
2021-12-12 01:05:23 +00:00
|
|
|
echo "0 4 * * * python /srv/miuitask.py" > /var/spool/cron/crontabs/root
|
|
|
|
|
2023-11-18 10:37:51 +00:00
|
|
|
VOLUME ["./data", "/srv/data"]
|
2021-12-12 01:05:23 +00:00
|
|
|
|
|
|
|
CMD ["/usr/sbin/crond", "-f"]
|