From bbc042a64218fdd6e7a6d18cd66d24d823ba7e5a Mon Sep 17 00:00:00 2001 From: Tim AtLee Date: Tue, 4 Jun 2024 12:12:17 -0600 Subject: [PATCH] Updated to current python ver. Learning how to make a container. --- Dockerfile | 2 +- README.md | 50 ++++++++++++++++++++++++++++++++++---------- docker-compose.yaml | 1 - requirements.txt | Bin 31 -> 284 bytes 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 136079d..bd7dbeb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.12-slim WORKDIR /app diff --git a/README.md b/README.md index c2daf9f..e620f00 100644 --- a/README.md +++ b/README.md @@ -5,44 +5,72 @@ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE) -Cloudflare DDNS is a configurable Docker service updating your CloudFlare DNS records periodically -to match your local IP address. +Cloudflare DDNS is a configurable Docker service updating your CloudFlare DNS records periodically +to match your local IP address. # Table of Content -- [Installation](#installation) +- [Cloudflare DDNS](#cloudflare-ddns) +- [Table of Content](#table-of-content) + - [Installation](#installation) - [Using a Pre-built Container](#using-a-pre-built-container) - [Building the Container Yourself](#building-the-container-yourself) + - [Hosting](#hosting) - [Running on the Host](#running-on-the-host) -- [Configuration](#configuration) + - [Configuration](#configuration) - [Getting a Cloudflare Token](#getting-a-cloudflare-token) - [Supported Options](#supported-options) -- [Contributing](#contributing) + - [Contributing](#contributing) ## Installation While this project is intended to be ran as a Docker container, it can also be ran on the host directly. +This container runs until terminated. It is not a cron job. + ### Using a Pre-built Container This project is available on the GitHub Container Registry. -``` -docker pull ghcr.io/akarys42/cloudflare-ddns-docker +```shell +docker pull git.home.timatlee.com/timatlee/cloudflare-ddns:latest ``` ### Building the Container Yourself -There are no special requirements when building this container! Simply use `docker build` in this folder. +There are no special requirements when building this container. Simply build with: + +```shell +docker build -t git.home.timatlee.com/timatlee/cloudflare-ddns:latest . +docker push git.home.timatlee.com/timatlee/cloudflare-ddns:latest +``` + +#### Hosting + +I am hosting this in my own Gitea repository. We can push this with: + +```shell +docker login git.home.timatlee.com +username: timatlee +password: // Gitea PAT token +``` ### Running on the Host +Python > 3.12 is required. This likely requires a virtualenv. + +```shell +python -m venv .env +.env\scripts\activate.ps1 +pip install -r requirements.txt +python -m cloudflare_ddns --token ... -d .. domain.example.com +``` + In order to run this project on the host, you'll need Python > 3.8, and an environment containing -the dependencies listed in [`requirements.txt`](requirements.txt). +the dependencies listed in [`requirements.txt`](requirements.txt). The project can then by launched by running the `cloudflare_ddns` module, usually using `python -m cloudflare_ddns`. - ## Configuration This project will accept parameters through environment variables or command line argument. @@ -71,5 +99,5 @@ Otherwise any found A or AAAA record pointing to this domain found will be used. ## Contributing -Any help would be greatly appreciated! +Any help would be greatly appreciated! Feel free to check our [open issues](https://github.com/Akarys42/cloudflare-ddns-docker/issues) and send us a Pull Request! diff --git a/docker-compose.yaml b/docker-compose.yaml index c8e76a6..a47fd21 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,4 @@ ## Development docker-compose -version: "3.7" services: cloudflare-ddns: build: diff --git a/requirements.txt b/requirements.txt index 0ef32ad735cd61a3341f0fe8779a0b594b0c5099..a73e0c754a633a8a0b0c1aee2fdf70a7338e17d5 100644 GIT binary patch literal 284 zcmYjM%MOAt0PESrPtlBFl#3sOQzH=}GPwBhYFpHpr8}(8y`Bjt3>eYiOze3g0q?MG0z-{&9iInl}KEDRBS* literal 31 kcmXR)Ei6qfE-9|FHPSOO)idNu&dE&9wy3kU&@%w?0IBl{U;qFB