Skip to content

http-server dockerized. Useful for serving local directories and files over http/https.

License

Notifications You must be signed in to change notification settings

mtozlu/http-server-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Http-Server-Docker

Serve any local directory over http/https using docker without any dependencies.

Uses http-server (https://www.npmjs.com/package/http-server) inside container.

This repository uses same version with http-server (https://github.com/http-party/http-server).

Running

Running this command in any directory serves its contents:

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

Visit: http://127.0.0.1:8080 or http://localhost:8080

Options

You can use available options on https://github.com/http-party/http-server#available-options as the last argument of docker run command.

docker run -d -p 8080:8080 -v "$(PWD):/public" tozlu/http-server "-c-1"

-c-1 command at the end is passed to http-server options. It disables caching of served files. There many more options such as enabling https, using brotli compression, etc.

Building Docker Image

docker build -t tozlu/http-server-docker:{new-version} -t tozlu/http-server-docker:latest . docker push tozlu/http-server-docker:{new-version} docker push tozlu/http-server-docker:latest

About

http-server dockerized. Useful for serving local directories and files over http/https.

Resources

License

Stars

Watchers

Forks