HTTP server which returns fake data
387
Fake http server wich returns the hostname of the running machine and the node name shared via environment variables
Run the image specifing the SERVER_NAME and publish the http port
With docker
docker run -it --rm --env SERVER_NAME=NODE_1 --publish 9000:3000 danny27071993/fake-http-server
With docker compose
version: '3.3'
networks:
network:
driver: bridge
services:
fake-http-server:
image: danny27071993/fake-http-server
ports:
- 9000:3000
healthcheck:
test: curl 127.0.0.1:3000/health
interval: 30s
timeout: 3s
retries: 5
networks:
- network
Build docker image
docker build -t danny27071993/fake-http-server .
Run a container based on the image
docker run -it --rm --env SERVER_NAME=NODE_1 --publish 9000:3000 danny27071993/fake-http-server
Check the connectivity
curl 127.0.0.1:9000
Push the image to docker hub
docker push danny27071993/fake-http-server
Last update 11/08/2024
Content type
Image
Digest
sha256:3d4bf1524…
Size
47.6 MB
Last updated
about 2 years ago
docker pull danny27071993/fake-http-server