add Dockerfile

This commit is contained in:
Dmitry Belyaev 2024-02-20 20:44:27 +03:00
parent 5804bb3d38
commit 4439a327ad
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3
3 changed files with 36 additions and 0 deletions

8
.dockerignore Normal file
View File

@ -0,0 +1,8 @@
.git/
.venv/
state/*
__pycache__
*.pyo
*.pyc
.env*

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
.venv/
state/*
__pycache__
*.pyo
*.pyc
.env*

26
Dockerfile Normal file
View File

@ -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'