pddnsc/Dockerfile

26 lines
520 B
Docker
Raw Normal View History

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-20 17:44:27 +00:00
$SCHEDULE cd /app && python -m pddnsc.cli \
" > /etc/crontabs/root && exec crond -l 1 -f'