diff --git a/.dockerignore b/.dockerignore index 080ffc9..6c154b2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,8 +1,9 @@ .dockerignore .git .gitignore +.gitmodules +cryptpad/.git customize +data docker-compose.yml Dockerfile -cryptpad/.git -.gitmodules diff --git a/Dockerfile b/Dockerfile index 0a6b2d9..61f3b3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..2670cbe --- /dev/null +++ b/MIGRATION.md @@ -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. \ No newline at end of file diff --git a/README.md b/README.md index 5e5117e..c7e0eaa 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..700d7a6 --- /dev/null +++ b/docker-compose.yml @@ -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 diff --git a/traefik2.yml b/traefik2.yml new file mode 100644 index 0000000..4ed8f1c --- /dev/null +++ b/traefik2.yml @@ -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 \ No newline at end of file