fixing readme and adding some comments
This commit is contained in:
parent
60df40beb9
commit
6acfaecb24
2 changed files with 13 additions and 3 deletions
11
README.md
11
README.md
|
@ -1,10 +1,16 @@
|
|||
# goStatic
|
||||
A really small static web server for Docker
|
||||
|
||||

|
||||
|
||||
[](https://imagelayers.io/?images=pierrezemb/gostatic:latest 'Get your own badge on imagelayers.io')
|
||||
[](https://godoc.org/github.com/PierreZ/goStatic)
|
||||
|
||||
### The goal
|
||||
My goal is to create to smallest docker container for my web static files. The advantage of Go is that you can generate a fully static binary, so that you don't need anything else.
|
||||
|
||||
### Features
|
||||
* A fully static web server in 5MB
|
||||
* Web server build for Docker
|
||||
* HTTPS by default
|
||||
* Can generate certificate on his onw
|
||||
|
@ -19,6 +25,7 @@ Because the official Golang image is wayyyy to big (around 1/2Gb as you can see
|
|||
|
||||
For me, the whole point of containers is to have a light container...
|
||||
Many links should provide you with additionnal info to see my point of view:
|
||||
|
||||
* [Over 30% of Official Images in Docker Hub Contain High Priority Security Vulnerabilities](http://www.banyanops.com/blog/analyzing-docker-hub/)
|
||||
* [Create The Smallest Possible Docker Container](http://blog.xebia.com/2014/07/04/create-the-smallest-possible-docker-container/)
|
||||
* [Building Docker Images for Static Go Binaries](https://medium.com/@kelseyhightower/optimizing-docker-images-for-static-binaries-b5696e26eb07)
|
||||
|
@ -27,9 +34,9 @@ Many links should provide you with additionnal info to see my point of view:
|
|||
### How to use
|
||||
```
|
||||
// HTTPS server
|
||||
docker run -d -p 443:8043 -v path/to/website:/srv/http pierrezemb/goStatic
|
||||
docker run -d -p 443:8043 -v path/to/website:/srv/http --name goStatic pierrezemb/gostatic
|
||||
// HTTP server
|
||||
docker run -d -p 80:8043 -v path/to/website:/srv/http pierrezemb/goStatic --forceHTTP
|
||||
docker run -d -p 80:8043 -v path/to/website:/srv/http --name goStatic pierrezemb/gostatic --forceHTTP
|
||||
```
|
||||
|
||||
### Wow, such container! What are you using?
|
||||
|
|
5
main.go
5
main.go
|
@ -1,3 +1,6 @@
|
|||
// This small program is just a small web server created in static mode
|
||||
// in order to provide the smallest docker image possible
|
||||
|
||||
package main // import "github.com/PierreZ/goStatic"
|
||||
|
||||
import (
|
||||
|
@ -23,7 +26,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
// Def & parsing of flags
|
||||
// Def of flags
|
||||
portPtr = flag.Int("p", 8043, "The listening port")
|
||||
pathPtr = flag.String("static", "/srv/http", "The path for the static files")
|
||||
crtPtr = flag.String("crt", "/etc/ssl/server", "Folder for server.pem and key.pem")
|
||||
|
|
Loading…
Reference in a new issue