mirror of
https://github.com/halverneus/static-file-server.git
synced 2024-11-24 17:15:29 +00:00
Merge pull request #7 from halverneus/chore/go_1_11_0
Updated to Go 1.11.0. Cleaned up README. Updated version of dep.
This commit is contained in:
commit
5d945a7ddf
@ -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 BUILD_DIR /go/src/github.com/halverneus/static-file-server
|
||||||
ENV MAIN github.com/halverneus/static-file-server/bin/serve
|
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 \
|
RUN curl -fsSL -o /usr/local/bin/dep \
|
||||||
https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && \
|
https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && \
|
||||||
|
4
Gopkg.lock
generated
4
Gopkg.lock
generated
@ -2,14 +2,16 @@
|
|||||||
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
|
digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202"
|
||||||
name = "gopkg.in/yaml.v2"
|
name = "gopkg.in/yaml.v2"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
|
pruneopts = "UT"
|
||||||
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
|
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
|
||||||
version = "v2.2.1"
|
version = "v2.2.1"
|
||||||
|
|
||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "ce4cfa8aa3eb29f45e7ba341fdeac9820969e663181e81bddfc4a3aa2d5169bb"
|
input-imports = ["gopkg.in/yaml.v2"]
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
16
README.md
16
README.md
@ -1,9 +1,12 @@
|
|||||||
# static-file-server
|
# static-file-server
|
||||||
|
|
||||||
Tiny, simple static file server using environment variables for configuration
|
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 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:
|
Environment variables with defaults:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Optional Hostname for binding. Leave black to accept any incoming HTTP request
|
# Optional Hostname for binding. Leave black to accept any incoming HTTP request
|
||||||
# on the prescribed port.
|
# on the prescribed port.
|
||||||
@ -40,27 +43,34 @@ tls-cert: ""
|
|||||||
tls-key: ""
|
tls-key: ""
|
||||||
```
|
```
|
||||||
|
|
||||||
### Without Docker
|
## Without Docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
PORT=8888 FOLDER=. ./serve
|
PORT=8888 FOLDER=. ./serve
|
||||||
```
|
```
|
||||||
|
|
||||||
Files can then be accessed by going to http://localhost:8888/my/file.txt
|
Files can then be accessed by going to http://localhost:8888/my/file.txt
|
||||||
|
|
||||||
### With Docker
|
## With Docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d -v /my/folder:/web -p 8080:8080 halverneus/static-file-server:latest
|
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
|
This will serve the folder "/my/folder" over http://localhost:8080/my/file.txt
|
||||||
|
|
||||||
Any of the variables can also be modified:
|
Any of the variables can also be modified:
|
||||||
|
|
||||||
```bash
|
```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
|
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
|
```bash
|
||||||
./serve help
|
./serve help
|
||||||
# OR
|
# OR
|
||||||
docker run -it halverneus/static-file-server:latest help
|
docker run -it halverneus/static-file-server:latest help
|
||||||
```
|
```
|
||||||
|
|
||||||
This maybe a cheesy program, but it is convenient and less than 6MB in size.
|
This maybe a cheesy program, but it is convenient and less than 6MB in size.
|
||||||
|
@ -19,11 +19,11 @@ var (
|
|||||||
MinorVersion = 3
|
MinorVersion = 3
|
||||||
|
|
||||||
// FixVersion of static-file-server.
|
// FixVersion of static-file-server.
|
||||||
FixVersion = 0
|
FixVersion = 1
|
||||||
|
|
||||||
// Text for directly accessing the static-file-server version.
|
// Text for directly accessing the static-file-server version.
|
||||||
Text = fmt.Sprintf(
|
Text = fmt.Sprintf(
|
||||||
"Version %d.%d.%d",
|
"v%d.%d.%d",
|
||||||
MajorVersion,
|
MajorVersion,
|
||||||
MinorVersion,
|
MinorVersion,
|
||||||
FixVersion,
|
FixVersion,
|
||||||
|
Loading…
Reference in New Issue
Block a user