Updated README with Docker Hub pointer

This commit is contained in:
2025-11-30 18:47:01 +00:00
parent 8479c98e39
commit 98898ee7ae

View File

@@ -2,25 +2,29 @@
Debian-based Docker image that runs hourly network speed tests (using speedtest-cli) and serves a simple web UI.
What the container provides
## Docker image
Docker[^1] image on [Docker Hub](https://hub.docker.com/repository/docker/asolkar/speed-data-docker/general)
## What the container provides
- Base: debian
- Installs: speedtest-cli
- Runs: a cron job to execute `run_speed_test.sh` hourly
- Serves: `index.html` and generated JS files on port 8080 via busybox httpd
Files added/edited
## Files added/edited
- `Dockerfile` - builds the image
- `start.sh` - entrypoint: starts cron and httpd
- `run_speed_test.sh` - existing script (copied into image)
Build locally
## Build locally
Make sure Docker is installed locally. From the project root run:
```bash
docker build -t speed-data-app .
```
Run container
## Run container
```bash
# Run with a named Docker volume (recommended). The container serves on $PORT inside the container
@@ -36,14 +40,14 @@ docker run -d --name speed-data -e PORT=8080 -p 8080:8080 --restart unless-stopp
speed-data-app
```
Verify
## Verify
- Visit http://localhost:8080 to view `index.html` (which reads `speedtest.js` and `speedtest.short.js`).
- Cron runs at minute 0 every hour. Logs go to `/var/log/cron.log` inside the container.
Notes
## Notes
- Data files (`speedtest.js`, `speedtest.short.js`, and the raw JSON file) are written to `/var/www/data/speed` inside the container. That path is declared as a Docker VOLUME in the `Dockerfile` so you can mount a named volume or a host directory.
- If you mount a host directory, ensure the directory is writeable by the container process. You can either:
- run the container as root (not recommended), or
- chown/chmod the host directory appropriately (e.g., `chown 1000:1000 /path/on/host` or `chmod a+rw /path/on/host`) so the container can write files.
Reminder: I built the image successfully after you started Docker locally. If you'd like, I can remove/recreate the container on your machine; tell me to proceed and I'll run the commands here.
[^1] _Note_: AI agent used to Dockerize existing project