Browse Source

First Version.

zry 5 years ago
parent
commit
909afefc41
3 changed files with 19 additions and 0 deletions
  1. 5 0
      Dockerfile
  2. 14 0
      main.go
  3. BIN
      z_docker_static_web_linux

+ 5 - 0
Dockerfile

@@ -0,0 +1,5 @@
+FROM alpine
+COPY z_docker_static_web /z_docker_static_web
+EXPOSE 8080
+ENV WWWROOT /var/www/
+ENTRYPOINT /z_docker_static_web

+ 14 - 0
main.go

@@ -0,0 +1,14 @@
+package main
+
+import (
+	"net/http"
+	"os"
+)
+
+var wwwroot string
+
+func main() {
+	wwwroot = os.Getenv("WWWROOT")
+	http.Handle("/", http.FileServer(http.Dir(wwwroot)))
+	http.ListenAndServe(":8080", nil)
+}

BIN
z_docker_static_web_linux