From 7800eb86e1419944b4f66bb6b2ba34a9a7785cb1 Mon Sep 17 00:00:00 2001 From: Jeromy Streets Date: Wed, 5 Sep 2018 10:45:06 -0700 Subject: [PATCH 1/2] Updated to Go 1.11.0. Cleaned up README. Updated version of dep. --- Dockerfile | 4 ++-- Gopkg.lock | 4 +++- cli/version/version.go | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b9cfa62..e1f0bfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM golang:1.10.3 as builder +FROM golang:1.11.0 as builder ENV BUILD_DIR /go/src/github.com/halverneus/static-file-server ENV MAIN github.com/halverneus/static-file-server/bin/serve -ENV DEP_VERSION v0.4.1 +ENV DEP_VERSION v0.5.0 RUN curl -fsSL -o /usr/local/bin/dep \ https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && \ diff --git a/Gopkg.lock b/Gopkg.lock index f0b7053..05423c8 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,14 +2,16 @@ [[projects]] + digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "UT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "ce4cfa8aa3eb29f45e7ba341fdeac9820969e663181e81bddfc4a3aa2d5169bb" + input-imports = ["gopkg.in/yaml.v2"] solver-name = "gps-cdcl" solver-version = 1 diff --git a/cli/version/version.go b/cli/version/version.go index 0a06c9c..c5ee869 100644 --- a/cli/version/version.go +++ b/cli/version/version.go @@ -19,11 +19,11 @@ var ( MinorVersion = 3 // FixVersion of static-file-server. - FixVersion = 0 + FixVersion = 1 // Text for directly accessing the static-file-server version. Text = fmt.Sprintf( - "Version %d.%d.%d", + "v%d.%d.%d", MajorVersion, MinorVersion, FixVersion, From 48bf7cdadd9366225483c6ddd7c0f087e95f14cb Mon Sep 17 00:00:00 2001 From: Jeromy Streets Date: Wed, 5 Sep 2018 10:47:39 -0700 Subject: [PATCH 2/2] Cleaned up README. --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e860211..1d0ac09 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # static-file-server + Tiny, simple static file server using environment variables for configuration Available on Docker Hub at https://hub.docker.com/r/halverneus/static-file-server/ +Available on GitHub at https://github.com/halverneus/static-file-server Environment variables with defaults: + ```bash # Optional Hostname for binding. Leave black to accept any incoming HTTP request # on the prescribed port. @@ -40,27 +43,34 @@ tls-cert: "" tls-key: "" ``` -### Without Docker +## Without Docker + ```bash PORT=8888 FOLDER=. ./serve ``` + Files can then be accessed by going to http://localhost:8888/my/file.txt -### With Docker +## With Docker + ```bash docker run -d -v /my/folder:/web -p 8080:8080 halverneus/static-file-server:latest ``` + This will serve the folder "/my/folder" over http://localhost:8080/my/file.txt Any of the variables can also be modified: + ```bash docker run -d -v /home/me/dev/source:/content/html -v /home/me/dev/files:/content/more/files -e FOLDER=/content -p 8080:8080 halverneus/static-file-server:latest ``` -### Also try... +## Also try... + ```bash ./serve help # OR docker run -it halverneus/static-file-server:latest help ``` + This maybe a cheesy program, but it is convenient and less than 6MB in size.