Sign inSign up

rwgrim/goserve

By rwgrim

•Updated over 5 years ago

goserve is a dead simple HTTP server whose sole purpose is to serve static content from a container.

Image
0

2.2K

rwgrim/goserve repository overview

This is a snapshot of https://keep.imfreedom.org/grim/goserve/file/tip/README.md⁠

⁠About

goserve is a dead simple HTTP server whose sole purpose is to serve static content from a container.

This was built because I was tired of introducing nginx or another web server into what would be a tiny container only containing the static files themselves.

⁠Building

If you're building this yourself, it is recommended to build it statically and strip the resulting binary with the following command.

CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static" -s' .

⁠Configuration

goserve is configurable via environment variables

  • GOSERVE_404_PAGE an optional custom html file for the 404 page
  • GOSERVE_ADDR the address it listen on (defaults to :3000)
  • GOSERVE_PREFIX a optional prefix to strip from the path, useful if using path based virtual hosts
  • GOSERVE_ROOT the root directory of the files to serve (defaults to html/)

Tag summary

Content type

Image

Digest

Size

1.8 MB

Last updated

over 5 years ago

docker pull rwgrim/goserve