commit 42801e5c6dbc33d935f513f6a789e70912b6915b Author: Michael Mandl Date: Fri May 22 16:28:09 2020 +0200 Initial project structure diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9906021 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3-alpine +RUN pip install --no-cache-dir --upgrade pip + +WORKDIR /app +COPY src/ ./ +CMD [ "python", "ddns_update.py" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..32860bf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: "2" + +services: + strato-ddns: + container_name: strato-ddns + build: + context: . + restart: always diff --git a/src/ddns_update.py b/src/ddns_update.py new file mode 100644 index 0000000..2170905 --- /dev/null +++ b/src/ddns_update.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +from time import sleep +import logging + +logging.basicConfig(level=logging.DEBUG) +log = logging.getLogger("ddns updater") + +if __name__ == "__main__": + log.info("starting...") + sequence = 1 + while True: + log.debug(f"update sequence {sequence}") + sequence += 1 + sleep(5)