changed speedtest service to ookla

This commit is contained in:
2026-03-10 03:37:02 +01:00
parent 90194076a6
commit 914f2ad2c9
7 changed files with 206 additions and 70 deletions

View File

@@ -1,14 +1,20 @@
FROM python:3.12-slim
RUN apt-get update && apt-get install -y cron git && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
# Install cron, curl, and the official Ookla Speedtest repository
RUN apt-get update && apt-get install -y cron curl \
&& curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash \
&& apt-get install -y speedtest \
&& rm -rf /var/lib/apt/lists/*
COPY . .
COPY crontab /etc/cron.d/speedtest
RUN chmod 0644 /etc/cron.d/speedtest && crontab /etc/cron.d/speedtest
# Set up the cron job
COPY crontab /etc/cron.d/speedtest-cron
RUN chmod 0644 /etc/cron.d/speedtest-cron
RUN crontab /etc/cron.d/speedtest-cron
ENV DB_PATH=/app/speedtests.db
# Dump env vars for cron and start the daemon
CMD printenv > /etc/environment && cron -f