From 2933f7112269f58c0f6387fd68afbd52d27972e7 Mon Sep 17 00:00:00 2001 From: Pixelhash Date: Wed, 14 Sep 2016 14:09:43 +0200 Subject: [PATCH] Add Docker support --- docker/.dockerignore | 1 + docker/Dockerfile | 18 +++++++++++++++ docker/README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++ docker/config.ini | 9 ++++++++ 4 files changed, 82 insertions(+) create mode 100644 docker/.dockerignore create mode 100644 docker/Dockerfile create mode 100644 docker/README.md create mode 100644 docker/config.ini diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 0000000..8781bde --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1 @@ +README* \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..2c2f972 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,18 @@ +FROM alpine:latest +MAINTAINER CodeHat + +LABEL linx-server_version="1.2.3" architecture="amd64" + +RUN apk add --update --no-cache curl + +RUN curl -L https://github.com/andreimarcu/linx-server/releases/download/v1.2.3/linx-server-v1.2.3_linux-amd64 -o /usr/bin/linx-server \ + && chmod 0755 /usr/bin/linx-server \ + && mkdir -p /srv/config /srv/storage/files /srv/storage/meta + +EXPOSE 8080 +WORKDIR /srv + +COPY config.ini /srv/config/ + +ENTRYPOINT ["/usr/bin/linx-server"] +CMD ["-config", "/srv/config/config.ini"] \ No newline at end of file diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..58127c0 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,54 @@ +# linx-server + +A simple [Docker](http://docker.com) image for [linx-server](https://github.com/andreimarcu/linx-server). + +[![](https://images.microbadger.com/badges/image/codehat/linx-server.svg)](http://microbadger.com/images/codehat/linx-server "Get your own image badge on microbadger.com") + +## Getting Started + +```sh +$ docker run -d -p 8080:8080 codehat/linx-server +``` + +Point your browser to `http://127.0.0.1:8080`. + +## Usage + +#### Default config.ini + +The image contains a default config.ini. + +``` +bind = 0.0.0.0:8080 +sitename = "My Linx Server" +# siteurl = "https://yoururl.example.com/" +filespath = "/srv/storage/files/" +metapath = "/srv/storage/meta/" +nologs = true +# certfile = "/srv/config/your.crt" +# keyfile = "/srv/config/your.key" +# authfile = "/srv/config/authfile" +``` + +#### Using local config.ini and keep storage folder + +Replace `/path/to/storage` and `/path/to/config` accordingly. +Also make sure that a `config.ini` exists in your `/path/to/config` folder and it is properly configured! + +```sh +$ docker run -d \ + -p 8080:8080 \ + -v /path/to/storage:/srv/storage \ + -v /path/to/config:/srv/config \ + codehat/linx-server +``` + +#### Enable API + +Use your own `config.ini` and uncomment the following line: +`# authfile = "/srv/config/authfile"` +gets to: +`authfile = "/srv/config/authfile"` + +Now generate an API key with the `linx-genkey` tool and put the key into the `/path/to/config/authfile`. +The next time you start your container, API will be enabled. \ No newline at end of file diff --git a/docker/config.ini b/docker/config.ini new file mode 100644 index 0000000..b100e07 --- /dev/null +++ b/docker/config.ini @@ -0,0 +1,9 @@ +bind = 0.0.0.0:8080 +sitename = "My Linx Server" +# siteurl = "https://yoururl.example.com/" +filespath = "/srv/storage/files/" +metapath = "/srv/storage/meta/" +nologs = true +# certfile = "/srv/config/your.crt" +# keyfile = "/srv/config/your.key" +# authfile = "/srv/config/authfile" \ No newline at end of file