mirror of
https://github.com/timothymiller/cloudflare-ddns.git
synced 2026-03-21 22:48:57 -03:00
Migrate cloudflare-ddns to Rust
Add Cargo.toml, Cargo.lock and a full src/ tree with modules and tests Update Dockerfile to build a Rust release binary and simplify CI/publish Remove legacy Python script, requirements.txt, and startup helper Switch .gitignore to Rust artifacts; update Dependabot and workflows to cargo Add .env example, docker-compose env, and update README and VSCode settings Remove the old Python implementation and requirements; add a Rust implementation with Cargo.toml/Cargo.lock and full src/ modules, tests, and notifier/heartbeat support. Update Dockerfile, build/publish scripts, dependabot and workflows, README, and provide env-based docker-compose and .env examples.
This commit is contained in:
27
Dockerfile
27
Dockerfile
@@ -1,18 +1,13 @@
|
||||
# ---- Base ----
|
||||
FROM python:alpine AS base
|
||||
# ---- Build ----
|
||||
FROM rust:alpine AS builder
|
||||
RUN apk add --no-cache musl-dev
|
||||
WORKDIR /build
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY src ./src
|
||||
RUN cargo build --release
|
||||
|
||||
#
|
||||
# ---- Dependencies ----
|
||||
FROM base AS dependencies
|
||||
# install dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip install --user -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 cloudflare-ddns.py .
|
||||
CMD ["python", "-u", "/cloudflare-ddns.py", "--repeat"]
|
||||
FROM alpine:latest AS release
|
||||
RUN apk add --no-cache ca-certificates
|
||||
COPY --from=builder /build/target/release/cloudflare-ddns /usr/local/bin/cloudflare-ddns
|
||||
CMD ["cloudflare-ddns", "--repeat"]
|
||||
|
||||
Reference in New Issue
Block a user