Sign inSign up

amnoorbrar/digital-clock

By amnoorbrar

•Updated 8 months ago

Lightweight Node.js digital clock with stopwatch, 12/24-hour format, and reliable Docker deployment.

Image
Internet of things
Web servers
0

2.5K

amnoorbrar/digital-clock repository overview

⁠Digital Clock

Digital Clock is a lightweight web app image with a live digital clock and stopwatch, packaged for reliable container runtime on Docker Hub and GHCR.

⁠What It Is

Digital Clock provides two focused user experiences:

  • A live digital clock with 12-hour and 24-hour display modes.
  • A stopwatch with start, stop, and reset controls.

The product is intentionally simple to use while staying fast, predictable, and easy to deploy in local or production-like container environments.

⁠How To Run

Pull from Docker Hub (primary) or GHCR (secondary):

docker pull amnoorbrar/digital-clock:latest
docker pull amnoorbrar/digital-clock:vX.Y.Z
docker pull ghcr.io/amnoor/digital-clock:latest
docker pull ghcr.io/amnoor/digital-clock:vX.Y.Z

Run with a hardened default container posture:

docker run --rm --user 1000:1000 --read-only --cap-drop ALL -p 8080:80 --tmpfs /tmp:rw,noexec,nosuid,size=16m --tmpfs /var/tmp:rw,noexec,nosuid,size=16m --name digital-clock-website amnoorbrar/digital-clock:latest

Run with runtime overrides:

docker run --rm --user 1000:1000 --read-only --cap-drop ALL -p 8080:80 -e PORT=80 -e DEBUG=true --tmpfs /tmp:rw,noexec,nosuid,size=16m --tmpfs /var/tmp:rw,noexec,nosuid,size=16m --name digital-clock-website amnoorbrar/digital-clock:vX.Y.Z

Access the app:

http://localhost:8080/
http://localhost:8080/stopwatch/

Tag guidance:

  • Use latest for newest published release.
  • Use vX.Y.Z for explicit semantic-version pinning.

⁠How It Works

The image runs a modular Node.js HTTP application without a web framework. Server-side modules handle routing, static file serving, MIME mapping, response helpers, logging, and runtime config injection. Browser-side modules handle clock rendering, preferences, stopwatch behavior, navigation, and client logging.

Runtime config is exposed through /config.js and provides window.APP_CONFIG.DEBUG to the browser.

Release publishing is tag-driven (v*) and produces multi-architecture images for linux/amd64 and linux/arm64 on both Docker Hub and GHCR.

The container image is built with a multi-stage Dockerfile and a minimal runtime footprint, then executed as a non-root user with a hardened runtime pattern.

Tag summary

Content type

Image

Digest

sha256:715a25999…

Size

45.9 MB

Last updated

8 months ago

docker pull amnoorbrar/digital-clock