From 68e33bb90236a9101c39910f659269ea2e7e4f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20N=C3=B6thlich?= Date: Tue, 5 May 2020 03:42:44 +0200 Subject: [PATCH] Remove docker related files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrian Nöthlich --- .dockerignore | 7 ---- .env | 4 --- .travis.yml | 11 ------ Dockerfile | 45 ----------------------- container-start.sh | 27 -------------- docker-compose.yml | 31 ---------------- docker-install-tini.sh | 25 ------------- docs/cryptpad-docker.md | 79 ----------------------------------------- 8 files changed, 229 deletions(-) delete mode 100644 .dockerignore delete mode 100644 .env delete mode 100644 .travis.yml delete mode 100644 Dockerfile delete mode 100755 container-start.sh delete mode 100644 docker-compose.yml delete mode 100755 docker-install-tini.sh delete mode 100644 docs/cryptpad-docker.md diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index f2099e1fc..000000000 --- a/.dockerignore +++ /dev/null @@ -1,7 +0,0 @@ -data -Dockerfile -docker-compose.yml -.dockerignore -.git -.gitignore -node_modules diff --git a/.env b/.env deleted file mode 100644 index 95961b566..000000000 --- a/.env +++ /dev/null @@ -1,4 +0,0 @@ -VERSION=latest -USE_SSL=true -STORAGE='./storage/file' -LOG_TO_STDOUT=true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c877e437e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -branches: - only: - - master - - soon - - staging -node_js: - - "6.6.0" -script: - - npm run-script lint - - docker build -t xwiki/cryptpad . diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index dcb07cf07..000000000 --- a/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# We use multi stage builds -FROM node:12-stretch-slim AS build - -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq git jq python curl -RUN npm install -g bower - -# install tini in this stage to avoid the need of jq and python -# in the final image -ADD docker-install-tini.sh /usr/local/bin/docker-install-tini.sh -RUN /usr/local/bin/docker-install-tini.sh - -COPY . /cryptpad -WORKDIR /cryptpad - -RUN npm install --production \ - && npm install -g bower \ - && bower install --allow-root - -FROM node:12-stretch-slim - -# You want USE_SSL=true if not putting cryptpad behind a proxy -ENV USE_SSL=false -ENV STORAGE="'./storage/file'" -ENV LOG_TO_STDOUT=true - -# Persistent storage needs -VOLUME /cryptpad/cfg -VOLUME /cryptpad/datastore -VOLUME /cryptpad/customize -VOLUME /cryptpad/blobstage -VOLUME /cryptpad/block -VOLUME /cryptpad/blob -VOLUME /cryptpad/data - -# Copy cryptpad and tini from the build container -COPY --from=build /sbin/tini /sbin/tini -COPY --from=build /cryptpad /cryptpad - -WORKDIR /cryptpad - -# Unsafe / Safe ports -EXPOSE 3000 3001 - -# Run cryptpad on startup -CMD ["/sbin/tini", "--", "/cryptpad/container-start.sh"] diff --git a/container-start.sh b/container-start.sh deleted file mode 100755 index 9f28d0127..000000000 --- a/container-start.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# Creating customize folder -mkdir -p customize - -# Copying default config -mkdir -p cfg -[ ! -f cfg/config.js ] && echo "Creating config.js" && cp config/config.example.js cfg/config.js - -# Linking config.js -[ ! -L config/config.js ] && echo "Linking config.js" && ln -s ../cfg/config.js config/config.js - - -# Thanks to http://stackoverflow.com/a/10467453 -sedeasy() { - sed -i "s/$1/$(echo $2 | sed -e 's/[\/&]/\\&/g')/g" $3 -} - -# Configure -[ -n "$STORAGE" ] && echo "Using storage adapter: $STORAGE" \ - && sedeasy "storage: [^,]*," "storage: ${STORAGE}," cfg/config.js - -[ -n "$LOG_TO_STDOUT" ] && echo "Logging to stdout: $LOG_TO_STDOUT" \ - && sedeasy "logToStdout: [^,]*," "logToStdout: ${LOG_TO_STDOUT}," cfg/config.js - -export FRESH=1 -exec node ./server.js diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index e0d977866..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,31 +0,0 @@ -version: '2' -services: - - cryptpad: - build: - context: . - args: - - VERSION=${VERSION} - image: "xwiki/cryptpad:${VERSION}" - hostname: cryptpad - - labels: - - traefik.port=3000 - - traefik.frontend.passHostHeader=true - environment: - - USE_SSL=${USE_SSL} - - STORAGE=${STORAGE} - - LOG_TO_STDOUT=${LOG_TO_STDOUT} - - ports: - - "3000:3000" - - "3001:3001" - - restart: always - volumes: - - ./data/files:/cryptpad/datastore:rw - - ./data/customize:/cryptpad/customize:rw - - ./data/blob:/cryptpad/blob:rw - - ./data/block:/cryptpad/block:rw - - ./data/config:/cryptpad/cfg:rw - - ./data/data:/cryptpad/data:rw diff --git a/docker-install-tini.sh b/docker-install-tini.sh deleted file mode 100755 index a9a92e871..000000000 --- a/docker-install-tini.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# Figure out latest release via GitHub API -release=$(curl --silent "https://api.github.com/repos/krallin/tini/releases/latest" | jq -r .tag_name) - -# _Reliable_ way to get which arch for tini download -arch=$(python < ./data/files -- cryptpad/customize --> ./data/customize -- cryptpad/pins --> ./data/pins -- cryptpad/blob --> ./data/blob -- cryptpad/blobstage --> ./data/blobstage -- cryptpad/tasks --> ./data/tasks -- cryptpad/block --> ./data/block - -Your configuration file will be in `./data/customize/config.js`. - -The data folder is ignored by git, so if you want to add your customizations to git versioning change the volume: - -``` -./customize:/cryptpad/customize:rw -``` - -## SSL Proxy - -The [traefik](https://traefik.io/) proxy has builtin Let'sEncrypt for easy SSL setup. -In the docker-compose file you can find preset lables for usage with traefik. - -[Traefik Docker Image](https://hub.docker.com/_/traefik/) - -Alternativly just use plain old nginx.