2024-02-20 17:44:27 +00:00
|
|
|
FROM python:3.12-alpine
|
|
|
|
|
|
|
|
ENV TZ Europe/Moscow
|
|
|
|
ENV SCHEDULE 1 * * * *
|
|
|
|
|
|
|
|
RUN set -x && \
|
2024-02-21 08:43:24 +00:00
|
|
|
apk add --no-cache --virtual .tz alpine-conf tzdata && \
|
2024-02-20 17:44:27 +00:00
|
|
|
/sbin/setup-timezone -z $TZ && \
|
2024-02-21 08:43:24 +00:00
|
|
|
apk del .tz
|
2024-02-20 17:44:27 +00:00
|
|
|
|
|
|
|
RUN mkdir /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY pddnsc ./pddnsc
|
2024-02-21 08:43:24 +00:00
|
|
|
RUN mkdir settings state
|
2024-02-20 17:44:27 +00:00
|
|
|
COPY requirements.txt .
|
|
|
|
|
2024-02-21 08:43:24 +00:00
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
2024-02-20 17:44:27 +00:00
|
|
|
|
2024-02-21 08:43:24 +00:00
|
|
|
VOLUME /app/settings
|
2024-02-20 17:44:27 +00:00
|
|
|
VOLUME /app/state
|
|
|
|
|
2024-02-21 08:43:24 +00:00
|
|
|
CMD sh -exc 'echo "\
|
2024-02-21 18:13:28 +00:00
|
|
|
$SCHEDULE date && cd /app && python -m pddnsc.cli \
|
2024-02-20 17:44:27 +00:00
|
|
|
" > /etc/crontabs/root && exec crond -l 1 -f'
|