Building and running:
docker build -t docker-server-demo:latest .
docker run --rm -p 8080:8080 docker-server-demo:latest

Testing with curl:
curl -s http://localhost:8080/items | python -m json.tool
curl -s http://localhost:8080/items/2 | python -m json.tool
curl -s "http://localhost:8080/search?q=notebook" | python -m json.tool
You may also try directly accessing this URL from your browser.

# error cases. Formatted so that only the status code is shown
curl -s -o /dev/null -w "%{http_code}\n" http://localhost:8080/items/999
curl -s -o /dev/null -w "%{http_code}\n" "http://localhost:8080/search"
curl -s -o /dev/null -w "%{http_code}\n" http://localhost:8080/does-not-exist