forked from alexplesoiu/dns-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcff5ad
commit 2651442
Showing
5 changed files
with
85 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
# Include any files or directories that you don't want to be copied to your | ||
# container here (e.g., local build artifacts, temporary files, etc.). | ||
# | ||
# For more help, visit the .dockerignore file reference guide at | ||
# https://docs.docker.com/go/build-context-dockerignore/ | ||
|
||
.env | ||
**/.DS_Store | ||
**/__pycache__ | ||
**/.venv | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose.y*ml | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dns_updater.log | ||
scripts/* | ||
.vscode/ | ||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM python:alpine | ||
|
||
# Prevents Python from writing pyc files. | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
# Keeps Python from buffering stdout and stderr to avoid situations where | ||
# the application crashes without emitting any logs due to buffering. | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
WORKDIR /app | ||
|
||
# Copy relevant files into the container | ||
COPY main.py /app | ||
COPY domains.json /app | ||
COPY functions.py /app | ||
COPY requirements.txt /app | ||
COPY domains.json /app | ||
|
||
RUN pip install --no-cache-dir -r /app/requirements.txt | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
--mount=type=bind,source=requirements.txt,target=requirements.txt \ | ||
python -m pip install -r requirements.txt | ||
|
||
CMD ["python", "main.py"] | ||
# Run the application. | ||
CMD ["python", "main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
#Docker compose for cloudflare-dns-updater | ||
version: "3.6" | ||
services: | ||
dns-updater: | ||
# Uncomment this to use an image instead of building locally | ||
# image: your-image-tag | ||
# Uncomment this to build locally | ||
build: . | ||
env_file: | ||
- .env | ||
|
||
cloudlfare-dns-updater: | ||
image: "cloudflare-dns-updater:latest" | ||
container_name: "cloudlfare-dns-updater" | ||
volumes: | ||
- app-data:/app # optional unless using the domains.json file and DOMAINS_FILE_PATH variable | ||
environment: | ||
CF_API_TOKEN: "YOUR_API_TOKEN" # Recomended to create a token for the zones, not use the main token | ||
CF_ZONE_ID: "YOUR_ZONE_ID1,YOUR_ZONE_ID2" # Can be only 1 zone ID (usually is) | ||
# Choose the method in which you get your domain records: | ||
# You must choose one method | ||
# DOMAINS_FILE_PATH is not needed if the DOMAINS or DNS_RECORD_COMMENT_KEY variables are set. | ||
# Edit the domains.json according to the example file in the mounted volume. | ||
# If you don't mount a volume, you cannot use the domains.json file and DOMAINS_FILE_PATH variable. | ||
|
||
DNS_RECORD_COMMENT_KEY: "Comm1,Comm2" # Any DNS reccord that has any of the comments specified here. Can be 1 comment | ||
# DOMAINS: "domain.com,example1.domain.com,example2.domain.com" | ||
# DOMAINS_FILE_PATH: .\domains.json | ||
SCHEDULE_MINUTES: 5 | ||
PROXIED: True # if proxied is set to True, TTL cannot be set/changed | ||
TYPE: A # Supports either A, AAA or CNAME | ||
TTL: 1 | ||
restart: "unless-stopped" | ||
|
||
volumes: | ||
app-data: | ||
driver: local | ||
driver_opts: | ||
o: bind | ||
type: none | ||
device: /volume1/docker/cloudflare-dns-updater |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters