diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9919b44 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git/ +.venv/ +state/* +__pycache__ +*.pyo +*.pyc +.env* + diff --git a/.gitignore b/.gitignore index c5ca132..e791976 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .venv/ state/* __pycache__ +*.pyo +*.pyc .env* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1630ddd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM python:3.12-alpine + +ENV TZ Europe/Moscow +ENV SCHEDULE 1 * * * * + +RUN set -x && \ + apk add --no-cache --virtual .tz alpine-conf tzdata && \ + /sbin/setup-timezone -z $TZ && \ + apk del .tz + +RUN mkdir /app +WORKDIR /app + +COPY pddnsc ./pddnsc +COPY settings ./settings +COPY state ./state +COPY requirements.txt . + +RUN pip install -r requirements.txt + +VOLUME /app/state + +CMD sh -c 'echo "\ +$SCHEDULE cd /app && python -m pddnsc.cli \ +" > /etc/crontabs/root && exec crond -l 1 -f' +