Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore everything
*

# Allow specific files and folders
!/requirements.txt
!/cloudflare-ddns.py
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"**/Thumbs.db": true,
".github": true,
".gitignore": true,
".dockerignore": true,
".vscode": true,
"Dockerfile": true,
"LICENSE": true,
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# ---- Base ----
FROM python:alpine AS base

ENV VENV_DIR="/app"
ENV PATH="${VENV_DIR}/bin:$PATH"

#
# ---- Dependencies ----
FROM base AS dependencies
# install dependencies
COPY requirements.txt .
RUN pip install --user -r requirements.txt
RUN python3 -m venv "${VENV_DIR}"
RUN pip install -r requirements.txt

#
# ---- Release ----
FROM base AS release
# copy installed dependencies and project source file(s)
WORKDIR /
COPY --from=dependencies /root/.local /root/.local
COPY --from=dependencies "${VENV_DIR}" "${VENV_DIR}"
COPY cloudflare-ddns.py .
CMD ["python", "-u", "/cloudflare-ddns.py", "--repeat"]
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,7 @@ services:
security_opt:
- no-new-privileges:true
network_mode: 'host'
environment:
- PUID=1000
- PGID=1000
user: 1000:1000
volumes:
- /YOUR/PATH/HERE/config.json:/config.json
restart: unless-stopped
Expand Down
5 changes: 1 addition & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
version: '3.9'
services:
cloudflare-ddns:
image: timothyjmiller/cloudflare-ddns:latest
container_name: cloudflare-ddns
security_opt:
- no-new-privileges:true
network_mode: 'host'
environment:
- PUID=1000
- PGID=1000
user: 1000:1000
volumes:
- /YOUR/PATH/HERE/config.json:/config.json
restart: unless-stopped