You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.4 KiB

  1. # Cryptpad Docker Image
  2. Cryptpad includes support for building a Docker image and running it to provide a Cryptpad instance. You can manage the container manually, or let Docker Compose manage it for you.
  3. A full tutorial is available [on the Cryptpad Github wiki](https://github.com/xwiki-labs/cryptpad/wiki/Docker). This document provides a brief overview.
  4. ## Features
  5. - Configuration via .env file
  6. - Ready for use with traffic
  7. - Using github master for now, release 0.3.0 too old
  8. - Creating customize folder
  9. - Adding config.js to customize folder
  10. - Persistance for datastore and customize folder
  11. ## Run
  12. Run from the cryptpad source directory, keeping instance state in `/var/cryptpad`:
  13. ```
  14. docker build -t xwiki/cryptpad .
  15. docker run --restart=always -d --name cryptpad -p 3000:3000 -p 3001:3001 \
  16. -v /var/cryptpad/files:/cryptpad/datastore \
  17. -v /var/cryptpad/customize:/cryptpad/customize \
  18. -v /var/cryptpad/blob:/cryptpad/blob \
  19. -v /var/cryptpad/blobstage:/cryptpad/blobstage \
  20. -v /var/cryptpad/pins:/cryptpad/pins \
  21. -v /var/cryptpad/tasks:/cryptpad/tasks \
  22. -v /var/cryptpad/block:/cryptpad/block \
  23. xwiki/cryptpad
  24. ```
  25. Or, using docker-compose and the included `docker-compose.yml`, keeping instance state in the current directory under `./data`:
  26. ```
  27. docker-compose up -d
  28. ```
  29. ## Configuration
  30. Set configurations Dockerfile or in .env (using docker-compose) file.
  31. - VERSION=latest
  32. - USE_SSL=false
  33. - STORAGE='./storage/file'
  34. - LOG_TO_STDOUT=true
  35. The .env variables are read by docker-compose and forwarded to docker container.
  36. On runtime, in `bin/container-start.sh` the settings are written to the `config.js` file.
  37. ## Persistance
  38. The docker-compose file is preconfigured to persist folders
  39. - cryptpad/datastore --> ./data/files
  40. - cryptpad/customize --> ./data/customize
  41. - cryptpad/pins --> ./data/pins
  42. - cryptpad/blob --> ./data/blob
  43. - cryptpad/blobstage --> ./data/blobstage
  44. - cryptpad/tasks --> ./data/tasks
  45. - cryptpad/block --> ./data/block
  46. Your configuration file will be in `./data/customize/config.js`.
  47. The data folder is ignored by git, so if you want to add your customizations to git versioning change the volume:
  48. ```
  49. ./customize:/cryptpad/customize:rw
  50. ```
  51. ## SSL Proxy
  52. The [traefik](https://traefik.io/) proxy has builtin Let'sEncrypt for easy SSL setup.
  53. In the docker-compose file you can find preset lables for usage with traefik.
  54. [Traefik Docker Image](https://hub.docker.com/_/traefik/)
  55. Alternativly just use plain old nginx.