Static http file server with cache control and metrics
1.6K
Serve is a very simple static file server in go.
You can map/share a directory with specific base uri, and you can show/hide the directory indexes.
It is support basic cache control headers.
It is support serve prometius metrics also.
image: hobord/go_static_httpfs
docker run -p 8100:8100 -v ./your_public:/app/public -e DIRECTORY=/app/public -e LOG=true hobord/go_static_httpfs
linux || mac
go get ./...
go build -o server server.go
windows
go get ./...
go build -o server.exe server.go
-p="8100" or env.PORT: port to serve on
-d="." or env.DIRECTORY: the directory of static files to host
-b="/" or env.BASE_URI: base uri of static files on the web
-k="300" or env.KEEPALIVE: http header keep-alive value
-c="max-age=2800" or env.CACHECONTROL: http header Cache-controll: value
-i="true" or env.DIRINDEX: show directories index
-l="true" or env.LOG: show requests logs
-m="true" or env.METRICS: generate / serve metrics
-mp="9090" or env.METRICS_PORT: serve metrics on port
Content type
Image
Digest
Size
7.5 MB
Last updated
over 7 years ago
docker pull hobord/go_static_httpfs