Add migrationguide, config for traefik and compose

Signed-off-by: Adrian Nöthlich <git@promasu.tech>
This commit is contained in:
Adrian Nöthlich 2020-05-06 15:28:01 +02:00
parent 733876c71b
commit 55704cf34c
No known key found for this signature in database
GPG Key ID: CBA6B4E35D326EFE
6 changed files with 78 additions and 6 deletions

View File

@ -1,8 +1,9 @@
.dockerignore
.git
.gitignore
.gitmodules
cryptpad/.git
customize
data
docker-compose.yml
Dockerfile
cryptpad/.git
.gitmodules

View File

@ -36,11 +36,11 @@ RUN mkdir /cryptpad/data
WORKDIR /cryptpad
# Volumes for data persistence
VOLUME /cryptpad/customize
VOLUME /cryptpad/datastore
VOLUME /cryptpad/data
VOLUME /cryptpad/block
VOLUME /cryptpad/blob
VOLUME /cryptpad/block
VOLUME /cryptpad/customize
VOLUME /cryptpad/data
VOLUME /cryptpad/datastore
# Ports
EXPOSE 3000 3001

26
MIGRATION.md Normal file
View File

@ -0,0 +1,26 @@
# Migration from version 3.16.0
Starting at version 3.17.0 Docker isn't part of the [main repository](https://github.com/xwiki-labs/cryptpad) anymore.
The Docker deployment is community maintained and not officially supported.
With the new repository comes a reworked Docker image and reworked docker-compose files, which require manual
intervention to keep working.
_**Notice:**_ xwiki/cryptpad_ was removed from Dockerhub as Docker is not supported officially.
Please use _promasu/cryptpad_ which is automaticly build from this repository.
See [Dockerhub](https://hub.docker.com/r/promasu/cryptpad) to get the suitable image for you. `:latest` should normally
do the job for you, as it's the last tagged release on the [main repository](https://github.com/xwiki-labs/cryptpad).
## Migration steps
1. Clone this repository. If you want to build the image yourself you have to pull the submodule.
(`git submodule update --init --recursive`)
2. Move the _data_ and _customize_ directories from the old location into the `cryptpad-docker` repository.
3. Move the configuration from `data/cfg/config.js` to `data/config.js`. Consider taking a look at the current
[example config](https://github.com/xwiki-labs/cryptpad/blob/master/config/config.example.js) if there are missing or
obsolet parameters in your configuration.
4. CryptPad now uses a dedicated user inside the repository which has no permission to access the currently saved files.
You need to execute `sudo chown -R 4001:4001 data customize` to set the correct permissions.
5. See the [README](README.md) for general instructions on using this repository.

View File

@ -5,3 +5,6 @@ This repository has been created as part of an ongoing effort to separate docker
The officially recommended deployment method is to use the `example.nginx.conf` file provided by the core repo and to manage updates directly on the host system using `git`, `npm` (as provided by [nvm](https://github.com/nvm-sh/nvm)) and `bower`.
Docker images and their supporting configuration files are provided as a community effort by those using them, with support provided by the core development team on a _best-effort_ basis. Keep in mind that the core team neither uses nor tests Docker images, so your results may vary.
## Migration
Please see the [migration guide](https://github.com/xwiki-labs/cryptpad-docker/blob/master/MIGRATION.md) for further information on switching to this repository.

28
docker-compose.yml Normal file
View File

@ -0,0 +1,28 @@
---
version: '2'
services:
cryptpad:
image: "promasu/cryptpad:latest"
hostname: cryptpad
volumes:
- ./data/blob:/cryptpad/blob
- ./data/block:/cryptpad/block
- ./customize:/cryptpad/customize
- ./data/config.js:/cryptpad/config/config.js
- ./data/data:/cryptpad/data
- ./data/files:/cryptpad/datastore
ports:
- "3000:3000"
- "3001:3001"
expose:
- "3000"
- "3001"
ulimits:
nofile:
soft: 1000000
hard: 1000000

14
traefik2.yml Normal file
View File

@ -0,0 +1,14 @@
---
version: '2'
services:
cryptpad:
labels:
- traefik.http.routers.cryptpad.rule=Host(`cryptpad.example.com`)
- traefik.http.routers.cryptpad-sandbox.rule=Host(`cryptpad-sandbox.example.com`)
- traefik.http.routers.cryptpad.tls="true"
- traefik.http.routers.cryptpad-sandbox.tls="true"
- traefik.http.routers.cryptpad.entrypoints="https"
- traefik.http.routers.cryptpad-sandbox.entrypoints="https"
- traefik.http.services.cryptpad.loadbalancer.server.port=3000
- traefik.http.services.cryptpad-sandbox.loadbalancer.server.port=3001