diff --git a/hastebin/Dockerfile b/hastebin/Dockerfile new file mode 100644 index 0000000..931ccef --- /dev/null +++ b/hastebin/Dockerfile @@ -0,0 +1,20 @@ +FROM debian:jessie + +MAINTAINER Ric Lister, rlister@gmail.com + +RUN DEBIAN_FRONTEND=noninteractive \ + apt-get update && \ + apt-get install -yq \ + git \ + nodejs npm + +RUN git clone https://github.com/seejohnrun/haste-server.git /app +WORKDIR /app +RUN npm install + +ADD ./app.sh /app/ +RUN chmod 755 app.sh + +EXPOSE 7777 + +CMD [ "./app.sh" ] diff --git a/hastebin/README.md b/hastebin/README.md new file mode 100644 index 0000000..c13b659 --- /dev/null +++ b/hastebin/README.md @@ -0,0 +1,25 @@ +# Hastebin + +[Hastebin](https://github.com/seejohnrun/haste-server) is a simple +pastebin, which can be installed on a protected network. + +This dockerfile builds an image that can be configured using +environment variables. This is done by writing `config.js` at runtime +from interpolated variables in `app.sh`. + +See `app.sh` for variable names. + +## Example use + +Writing pastes to a mounted local volume: + +``` +docker run --name hastebin -d -p 7777:7777 -e STORAGE_TYPE=file -e /data:/app/data rlister/hastebin +``` + +Writing pastes to redis: + +``` +docker run --name redis -d redis +docker run --name hastebin -d -p 7777:7777 --link redis:redis -e STORAGE_HOST=redis rlister/hastebin +``` diff --git a/hastebin/app.sh b/hastebin/app.sh new file mode 100644 index 0000000..d045010 --- /dev/null +++ b/hastebin/app.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +## write config file from environment vars +cat > config.js <