Sign inSign up

gnarr/ok

By gnarr

•Updated 5 months ago

A minimal Rust webserver that returns OK and status 200

Image
1

2.6K

gnarr/ok repository overview

⁠Ok — minimal zero-dependency Rust webserver

docker arch docker size docker pulls docker version

release and build unsafe license rustc release

contributions

A minimal Rust webserver that responds with OK on HTTP request. It's designed to be a tiny, zero-dependency binary that listens on a configurable port.

⁠Quick Start

docker run -d -p 8080:8080 gnarr/ok
curl http://localhost:8080
# OK

⁠Features

  • Single-source-file Rust server (no external crates)
  • Multi‑architecture Docker images (amd64, arm64, arm/v7) via Docker Buildx

⁠Configuration

VariableDescriptionDefault
PORTTCP port the server binds to8080
SHOW_FAVICONWhether to serve /favicon.ico (set to "false" to disable it)true (any value other than "false" enables it)
THREAD_POOL_SIZENumber of worker threads to spawn (falls back to CPU count or 4)CPU core count (via available_parallelism) or 4 if unknown

⁠Usage

⁠Docker
# pull from Docker Hub
docker pull gnarr/ok:latest

# Run container:
docker run -d -p 8080:8080 \
-e PORT=8080 \
gnarr/ok:latest
⁠Build and run locally
# Compile in release mode
cargo build --release

# Run the server (default port 8080)
./target/release/ok

# Or specify a port:
PORT=9000 ./target/release/ok

Verify:

curl http://localhost:8080
# Should return 'OK' with HTTP 200
⁠Docker Compose

Create a docker-compose.yml in your project root:

services:
  ok-server:
    image: gnarr/ok:latest
    ports:
      - "8080:8080"
    environment:
      PORT: 8080

Run:

docker-compose up -d

Then curl http://localhost:8080 to see OK.

Tag summary

Content type

Image

Digest

sha256:694222f6b…

Size

10.4 MB

Last updated

5 months ago

docker pull gnarr/ok