Added docker-compose build steps to README.md
This commit is contained in:
parent
7e8791c879
commit
1e55144bf2
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -9,7 +9,7 @@
|
|||||||
".vscode": true,
|
".vscode": true,
|
||||||
"LICENSE": true,
|
"LICENSE": true,
|
||||||
"requirements.txt": true,
|
"requirements.txt": true,
|
||||||
"build-docker-image.sh": true,
|
"build-docker-image.sh": false,
|
||||||
".gitignore": true,
|
".gitignore": true,
|
||||||
"Dockerfile": false,
|
"Dockerfile": false,
|
||||||
"start-sync.sh": false,
|
"start-sync.sh": false,
|
||||||
|
|||||||
@ -14,5 +14,4 @@ FROM dependencies AS release
|
|||||||
# copy project file(s)
|
# copy project file(s)
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY cloudflare-ddns.py .
|
COPY cloudflare-ddns.py .
|
||||||
COPY config.json .
|
|
||||||
CMD ["python", "/cloudflare-ddns.py", "--repeat"]
|
CMD ["python", "/cloudflare-ddns.py", "--repeat"]
|
||||||
48
README.md
48
README.md
@ -45,14 +45,54 @@ Alternatively, you can use the traditional API keys by setting appropriate value
|
|||||||
## :fax: Hosting multiple domains on the same IP?
|
## :fax: Hosting multiple domains on the same IP?
|
||||||
You can save yourself some trouble when hosting multiple domains pointing to the same IP address (in the case of Traefik) by defining one A & AAAA record 'ddns.example.com' pointing to the IP of the server that will be updated by this DDNS script. For each subdomain, create a CNAME record pointing to 'ddns.example.com'. Now you don't have to manually modify the script config every time you add a new subdomain to your site!
|
You can save yourself some trouble when hosting multiple domains pointing to the same IP address (in the case of Traefik) by defining one A & AAAA record 'ddns.example.com' pointing to the IP of the server that will be updated by this DDNS script. For each subdomain, create a CNAME record pointing to 'ddns.example.com'. Now you don't have to manually modify the script config every time you add a new subdomain to your site!
|
||||||
|
|
||||||
## :whale: Deploy to Docker
|
## :whale: Deploy with Docker Compose
|
||||||
|
|
||||||
Create a config.json file with your production credentials and run the build-docker-image script.
|
Modify the host file path of config.json inside the volumes section of docker-compose.yml.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3.7"
|
||||||
|
services:
|
||||||
|
cloudflare-ddns:
|
||||||
|
image: timothymiller/cloudflare-ddns:latest
|
||||||
|
container_name: cloudflare-ddns
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
environment:
|
||||||
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
|
volumes:
|
||||||
|
- /EDIT/YOUR/PATH/HERE/config.json:/config.json
|
||||||
|
restart: unless-stopped
|
||||||
|
```
|
||||||
|
|
||||||
|
### :running: Running
|
||||||
|
|
||||||
|
From the project root directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building from source
|
||||||
|
|
||||||
|
Create a config.json file with your production credentials.
|
||||||
|
|
||||||
|
Give build-docker-image.sh permission to execute.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo chmod +x ./build-docker-image.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
At project root, run the build-docker-image.sh script.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
chmod +x ./build-docker-image.sh
|
|
||||||
./build-docker-image.sh
|
./build-docker-image.sh
|
||||||
docker run -d timothymiller/cloudflare_ddns:latest
|
```
|
||||||
|
|
||||||
|
#### Run the locally compiled version
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -d timothyjmiller/cloudflare_ddns:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## :penguin: (legacy) Linux + cron instructions (all distros)
|
## :penguin: (legacy) Linux + cron instructions (all distros)
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
docker build -t timothymiller/cloudflare-ddns:latest .
|
docker build -t timothyjmiller/cloudflare-ddns:latest .
|
||||||
@ -1,7 +1,5 @@
|
|||||||
import requests
|
import requests, json, sys, os
|
||||||
import json
|
import time, traceback
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
PATH = os.getcwd() + "/"
|
PATH = os.getcwd() + "/"
|
||||||
version = float(str(sys.version_info[0]) + "." + str(sys.version_info[1]))
|
version = float(str(sys.version_info[0]) + "." + str(sys.version_info[1]))
|
||||||
@ -104,9 +102,6 @@ def cf_api(endpoint, method, config, headers={}, data=False):
|
|||||||
|
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
# Scheduling
|
|
||||||
import time, traceback
|
|
||||||
|
|
||||||
def every(delay, task):
|
def every(delay, task):
|
||||||
next_time = time.time() + delay
|
next_time = time.time() + delay
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
version: "3.7"
|
||||||
|
services:
|
||||||
|
cloudflare-ddns:
|
||||||
|
image: timothymiller/cloudflare-ddns:latest
|
||||||
|
container_name: cloudflare-ddns
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
environment:
|
||||||
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
|
volumes:
|
||||||
|
- /EDIT/YOUR/PATH/HERE/config.json:/config.json
|
||||||
|
restart: unless-stopped
|
||||||
Reference in New Issue
Block a user