From 644f8c8619d12bb623242a05de65fdd6b691f06c Mon Sep 17 00:00:00 2001 From: Wonderfall Date: Fri, 14 Jul 2017 05:27:34 +0200 Subject: [PATCH] add cryptpad --- cryptpad/Dockerfile | 23 +++++++++++++++++++++++ cryptpad/container-start.sh | 13 +++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 cryptpad/Dockerfile create mode 100755 cryptpad/container-start.sh diff --git a/cryptpad/Dockerfile b/cryptpad/Dockerfile new file mode 100644 index 0000000..1ae9287 --- /dev/null +++ b/cryptpad/Dockerfile @@ -0,0 +1,23 @@ +FROM node:8-alpine + +ARG VERSION=1.10.1 + +WORKDIR /cryptpad + +RUN apk add --no-cache git tini su-exec ca-certificates libressl tar \ + && wget -qO- https://github.com/xwiki-labs/cryptpad/archive/${VERSION}.tar.gz | tar xz --strip 1 \ + && npm install \ + && npm install -g bower \ + && bower install --allow-root + +EXPOSE 3000 + +VOLUME /cryptpad/datastore +VOLUME /cryptpad/customize + +ENV UID=991 GID=991 +ENV USE_SSL=false +ENV STORAGE='./storage/file' +ENV LOG_TO_STDOUT=true + +CMD ["/cryptpad/container-start.sh"] diff --git a/cryptpad/container-start.sh b/cryptpad/container-start.sh new file mode 100755 index 0000000..030ca98 --- /dev/null +++ b/cryptpad/container-start.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Creating customize folder +mkdir -p customize +[ -z "$(ls -A customize)" ] && echo "Creating customize folder" \ + && cp -R customize.dist/* customize/ \ + && cp config.example.js customize/config.js + +# Linking config.js +[ ! -h config.js ] && echo "Linking config.js" && ln -s customize/config.js config.js + +chown -R $UID:$GID /cryptpad +exec su-exec $UID:$GID /sbin/tini -- node ./server.js