Public | Automated Build

Last pushed: a year ago
Short Description
Run a web server from your current directory without installing Nginx, Nodejs, NPM, etc.
Full Description

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 danjellz/http-server

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:

[]

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 danjellz/http-server

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 danjellz/http-server"

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

Docker Pull Command
Owner
danjellz
Source Repository