From eee2789b9f5794ab24d76e08cb563d23f2577853 Mon Sep 17 00:00:00 2001 From: auzias Date: Tue, 13 Sep 2016 13:36:44 +0200 Subject: [PATCH] Docker details added. The `Dockerfile` is in the directory Docker. The image can be built from this, and run with the two option described in the `README.srt`. --- Docker/Dockerfile | 22 ++++++++++++++++++++++ README.rst | 17 ++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 Docker/Dockerfile diff --git a/Docker/Dockerfile b/Docker/Dockerfile new file mode 100644 index 0000000..bee7451 --- /dev/null +++ b/Docker/Dockerfile @@ -0,0 +1,22 @@ +FROM alpine:latest +MAINTAINER Maƫl Auzias + + +# python3 +RUN adduser -S python +RUN apk --no-cache add python3 + +# pip3 +RUN apk --no-cache add curl \ + ca-certificates \ + && curl -O https://bootstrap.pypa.io/get-pip.py \ + && python3 get-pip.py \ + && rm get-pip.py + +# 0bin https://github.com/sametmax/0bin +RUN pip install zerobin \ + && chown python:root -R /usr/lib/python3.5/site-packages/zerobin/ + +USER python + +ENTRYPOINT [ "zerobin", "--host=0.0.0.0" ] diff --git a/README.rst b/README.rst index 75c2986..eeb9d6e 100644 --- a/README.rst +++ b/README.rst @@ -24,6 +24,21 @@ but in short:: 0bin runs on Python 2.7 and Python 3.4. + +Docker +====== + +A Docker image is available. The [`Dockerfile`](Docker/Dockerfile) is in the `Docker` directory. Once in the directory, build the image with the command: + + docker build -t 0bin . + +Then run it with the command: + + docker run -p 8000:8000 -d -v /host/path/to/content/dir:/usr/lib/python3.5/site-packages/zerobin/static/content + +The option `-p 8000:8000` is needed to publish the port of the service. As for the option `-v /host/path/to/content/dir:/usr/lib/python3.5/site-packages/zerobin/static/content`, it is needed to persist the data. + + How it works ============= @@ -113,7 +128,7 @@ For small fixes (typo and such), you can work on master. For features, you should create a dedicated branch. -In any case, if you modify Javascript or CSS files, you shall run compress.sh afterward to provide the minified files. It requires your to have yui-compressor installed (apt-get install yui-compressor on the debian family). +In any case, if you modify Javascript or CSS files, you shall run compress.sh afterward to provide the minified files. It requires your to have yui-compressor installed (`apt-get install yui-compressor` on the debian family). We don't require you to rebase/merge, ordinary merging is alright.