pddnsc/Dockerfile

26 lines
528 B
Docker
Raw Normal View History

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