NTP-Timeturner/docker-compose.yml
Chaos Rogers 323cc61ae3 feat: integrate Statime PTP daemon into Dockerfile and docker-compose
Co-authored-by: aider (openai/gpt-5) <aider@aider.chat>
2025-10-21 22:59:55 +01:00

48 lines
1.2 KiB
YAML

version: "3.8"
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: ntp_timeturner
environment:
- RUST_LOG=info
ports:
- "8080:8080"
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