From 42801e5c6dbc33d935f513f6a789e70912b6915b Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Fri, 22 May 2020 16:28:09 +0200 Subject: [PATCH] Initial project structure --- Dockerfile | 6 ++++++ docker-compose.yml | 8 ++++++++ src/ddns_update.py | 15 +++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 src/ddns_update.py 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)