From 2e5521ce7dde35aef0beda44b3ecbba78fa15934 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Thu, 15 Sep 2016 22:26:35 -0700 Subject: [PATCH 1/2] Add Dockerfile This will build the binary directly in the image without a need to have Go installed locally. --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ff81bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:alpine + +RUN set -ex \ + && apk add --no-cache --virtual .build-deps git mercurial \ + && go get github.com/andreimarcu/linx-server \ + && apk del .build-deps + +VOLUME ["/data/files", "/data/meta"] + +EXPOSE 8080 +USER nobody +ENTRYPOINT ["/go/bin/linx-server", "-bind=0.0.0.0:8080", "-filespath=/data/files/", "-metapath=/data/meta/"] +CMD ["-sitename=linx", "-allowhotlink"] From 932a470ead2aa7ebc19a62f68339f28c11adbc0b Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Sat, 17 Sep 2016 20:20:46 -0700 Subject: [PATCH 2/2] add Docker instructions to readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index af844e3..780384d 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,15 @@ Run linx-server with the ```-certfile path/to/cert.file``` and ```-keyfile path/ #### 3. Using the built-in http server Run linx-server normally. +#### 4. Using Docker with the built-in http server +First, build the image: +```docker build -t linx-server .``` + +You'll need some directories for the persistent storage. For the purposes of this example, we will use `/media/meta` and `/media/files`. + +Then, run it: +```docker run -p 8080:8080 -v /media/meta:/data/meta -v /media/files:/data/files linx-server``` + Development -----------