Sign inSign up

capriciousduck/http-server

By capriciousduck

•Updated 3 months ago

Image
0

4.1K

capriciousduck/http-server repository overview

⁠Http-Server

Run a web server from your current directory without installing Nginx, Nodejs, NPM, etc.

⁠Basic Functionality

To see basic functionality, run without arguments:

docker run -it --rm -p 8080:8080 -v $(PWD):/public capriciousduck/http-server:amd64

Output:

Starting up http-server, serving ./
Available on:
  http://127.0.0.1:8080
  http://172.17.0.2:8080
Hit CTRL-C to stop the server

You can now visit the site in your web browser:

[Preview]

⁠Daemon Mode

Like many images you can run your container in daemon mode by using the -d switch with the Docker run command:

docker run -d -p 8080:8080 -v $(PWD):/public capriciousduck/http-server:amd64

⁠Tips

⁠Alias

Creating an alias in your ~/.bashrc or ~/.zshrc files can make this command much shorter. Example:

alias http-server="docker run -it --rm -p 8080:8080 -v $(PWD):/public capriciousduck/http-server:amd64"

Allowing you to run the following and mount your current directory

http-server
⁠Source:

Uses the NPM package found here: https://www.npmjs.com/package/http-server⁠

Tag summary

Content type

Image

Digest

sha256:acc665654…

Size

62.8 MB

Last updated

3 months ago

docker pull capriciousduck/http-server