From bc78fb0011c8feadad68af8ec89c08e58e16ff5f Mon Sep 17 00:00:00 2001 From: Dryusdan Date: Tue, 21 Nov 2017 12:08:31 +0000 Subject: [PATCH] init --- Dockerfile | 31 +++++++++++++++++++++++++++++++ README.md | 35 +++++++++++++++++++++++++++++++++++ run.sh | 13 +++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100755 run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..517fca0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM alpine:3.6 + +ARG VERSION=1.20.0 + +ENV UID=991 GID=991 + +WORKDIR /cryptpad + +RUN apk -U add --no-cache \ + git \ + tini \ + su-exec \ + ca-certificates \ + libressl \ + tar \ + nodejs-current \ + nodejs-current-npm \ + && 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 + +COPY run.sh /usr/local/bin/run.sh + +RUN chmod +x /usr/local/bin/run.sh + +EXPOSE 3000 + +VOLUME /cryptpad/datastore /cryptpad/customize + +CMD ["run.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b27172 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +## wonderfall/cryptpad + +The Zero Knowledge Cloud. + +#### Features +- Based on Alpine Linux +- Bundled with latest node.js available. + +#### Build-time variables +- **VERSION** : version of Cryptpad + +#### Environment variables +- **UID** : user id *(default : 991)* +- **GID** : group id *(default : 991)* + +#### Volumes +- **/cryptpad/datastore** : Cryptpad data +- **/cryptpad/customize** : Cryptpad custom files + +#### Ports +- **3000** [(reverse proxy!)](https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration) + +#### docker-compose.yml sample + +``` +cryptpad: + image: wonderfall/cryptpad + container_name: cryptpad + environment: + - UID=1444 + - GID=1444 + volumes: + - /mnt/docker/cryptpad/files:/cryptpad/datastore + - /mnt/docker/cryptpad/customize:/cryptpad/customize +``` diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..030ca98 --- /dev/null +++ b/run.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