From e5a2c521207cbdf43fd7dc661510b78f1e151bfb Mon Sep 17 00:00:00 2001 From: Chaos Rogers Date: Tue, 21 Oct 2025 23:13:35 +0100 Subject: [PATCH] chore: drop ptp-probe/statime and run haci in Docker Co-authored-by: aider (openai/gpt-5) --- Dockerfile | 15 +++++---------- docker-compose.yml | 37 ++----------------------------------- 2 files changed, 7 insertions(+), 45 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1624a40..69fa8cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,13 +18,11 @@ RUN mkdir -p src && echo 'fn main() { println!("cargo:rerun-if-changed=build.rs" RUN cargo build --release || true RUN rm -rf src -# Copy full source and build real binaries +# Copy full source and build project COPY . . -RUN cargo build --release --bin ntp_timeturner --bin ptp_probe +RUN cargo build --release -# Build and install the Statime PTP daemon (from crates.io) -# This installs the 'statime' binary into /usr/local/cargo/bin/statime in the builder image. -RUN cargo install --locked statime-linux --version 0.4.0 +# (Statime installation removed; container runs only haci) # Runtime image FROM debian:bookworm-slim AS runtime @@ -37,13 +35,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /app -COPY --from=builder /app/target/release/ntp_timeturner /usr/local/bin/ntp_timeturner -COPY --from=builder /app/target/release/ptp_probe /usr/local/bin/ptp_probe -COPY --from=builder /usr/local/cargo/bin/statime /usr/local/bin/statime +COPY --from=builder /app/target/release/get-haci /usr/local/bin/get-haci COPY static ./static ENV RUST_LOG=info EXPOSE 8080 -# Default to running the main server -CMD ["ntp_timeturner"] +CMD ["get-haci"] diff --git a/docker-compose.yml b/docker-compose.yml index 45d54d8..1303cee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ version: "3.8" services: - app: + haci: build: context: . dockerfile: Dockerfile - container_name: ntp_timeturner + container_name: haci environment: - RUST_LOG=info ports: @@ -13,36 +13,3 @@ services: volumes: - ./static:/app/static:ro restart: unless-stopped - - # Optional: probe a PTP hardware clock (Linux host with /dev/ptp0) - ptp-probe: - build: - context: . - dockerfile: Dockerfile - image: ntp_timeturner:latest - profiles: - - hw - command: ["ptp_probe", "--device", "/dev/ptp0", "--interval", "1.0", "--count", "0"] - devices: - - "/dev/ptp0:/dev/ptp0" - restart: "no" - - # PTP daemon using Statime (software PTP inside the container) - # Note: On macOS with Docker Desktop, low-level PTP networking features are limited. - # This service is most effective on a Linux host. Still useful for dev/testing. - statime: - build: - context: . - dockerfile: Dockerfile - image: ntp_timeturner:latest - container_name: statime - cap_add: - - NET_ADMIN - - NET_RAW - - SYS_TIME - command: ["statime", "-i", "eth0"] - # Expose standard PTP ports (udp/319, udp/320) - ports: - - "319:319/udp" - - "320:320/udp" - restart: unless-stopped