|
| 1 | +import {DocTopHeader} from "../../../src/components/DocTopHeader"; |
| 2 | +import {DocLink} from "../../../src/components/DocLink"; |
| 3 | +import {CodeBlock} from "../../../src/components/DocCodeBlock"; |
| 4 | + |
| 5 | +export default function () { |
| 6 | + return <div className="overflow-y-auto"> |
| 7 | + <DocTopHeader text="Docker"/> |
| 8 | + <span className="text-white">The official Docker image is available on <DocLink href="https://hub.docker.com/r/etherpad/etherpad" children="Etherpad Docker link"/>.</span> |
| 9 | + |
| 10 | + <DocTopHeader text="Downloading from DockerHub"/> |
| 11 | + <span className="text-white">If you are ok downloading a <DocLink href="https://hub.docker.com/r/etherpad/etherpad" children="prebuilt image from Docker Hub"/>, these are the commands:</span> |
| 12 | + |
| 13 | + |
| 14 | + <CodeBlock lang={"bash"}> |
| 15 | + { |
| 16 | + [ |
| 17 | + '# gets the latest published version', |
| 18 | + 'docker pull etherpad/etherpad', |
| 19 | + '', |
| 20 | + '# gets a specific version', |
| 21 | + 'docker pull etherpad/etherpad:1.8.0' |
| 22 | + ].join('\n') |
| 23 | + } |
| 24 | + </CodeBlock> |
| 25 | + <DocTopHeader text="Build a personalized container"/> |
| 26 | + <p className="text-white"> |
| 27 | + If you want to use a personalized settings file, you will have to rebuild your image. All of the following instructions are as a member of the docker group. By default, the Etherpad Docker image is built and run in production mode: no development dependencies are installed, and asset bundling speeds up page load time. |
| 28 | + </p> |
| 29 | + |
| 30 | + <DocTopHeader text="Rebuilding with custom settings"/> |
| 31 | + <p className="text-white"> |
| 32 | + Edit <code><<span>BASEDIR</span>/>/settings.json.docker</code> at your will. When rebuilding the image, this file will be copied inside your image and renamed to settings.json. |
| 33 | + |
| 34 | + Each configuration parameter can also be set via an environment variable, using the syntax <code>${ENV_VAR}</code> or <code>${ENV_VAR:default_value}</code>. For details, refer to settings.json.template. |
| 35 | + </p> |
| 36 | + |
| 37 | + <DocTopHeader text="Rebuilding including some plugins"/> |
| 38 | + <p className="text-white"> |
| 39 | + If you want to install some plugins in your container, it is sufficient to list them in the ETHERPAD_PLUGINS build variable. The variable value has to be a space separated, double quoted list of plugin names (see examples). |
| 40 | + |
| 41 | + Some plugins will need personalized settings. Just refer to the previous section, and include them in your custom <code>settings.json.docker</code>. |
| 42 | + </p> |
| 43 | + |
| 44 | + <DocTopHeader text="Rebuilding including export functionality for DOC/PDF/ODT"/> |
| 45 | + <p className="text-white"> |
| 46 | + If you want to be able to export your pads to DOC/PDF/ODT files, you can install either Abiword or Libreoffice via setting a build variable. |
| 47 | + </p> |
| 48 | + |
| 49 | + <DocTopHeader text="Via Abiword"/> |
| 50 | + <p className="text-white"> |
| 51 | + For installing Abiword, set the INSTALL_ABIWORD build variable to any value. |
| 52 | + |
| 53 | + Also, you will need to configure the path to the abiword executable via setting the abiword property in <code><<span>BASEDIR</span>/>/settings.json.docker</code> to <code>/usr/bin/abiword</code> or via setting the environment variable <code>ABIWORD</code> to <code>/usr/bin/abiword</code>. |
| 54 | + </p> |
| 55 | + <DocTopHeader text="Via Libreoffice"/> |
| 56 | + |
| 57 | + <p className="text-white"> |
| 58 | + For installing Libreoffice instead, set the INSTALL_SOFFICE build variable to any value. |
| 59 | + |
| 60 | + Also, you will need to configure the path to the libreoffice executable via setting the soffice property in <code><<span>BASEDIR</span>/>/settings.json.docker</code> to <code>/usr/bin/soffice</code> or via setting the environment variable <code>SOFFICE</code> to <code>/usr/bin/soffice</code>. |
| 61 | + </p> |
| 62 | + |
| 63 | + <DocTopHeader text="Examples"/> |
| 64 | + <p className="text-white"> |
| 65 | + Build a Docker image from the currently checked-out code: |
| 66 | + </p> |
| 67 | + |
| 68 | + <CodeBlock lang="bash"> |
| 69 | + { |
| 70 | + [ |
| 71 | + 'docker build --tag <YOUR_USERNAME>/etherpad .' |
| 72 | + ].join('\n') |
| 73 | + } |
| 74 | + </CodeBlock> |
| 75 | + |
| 76 | + <p className="text-white"> |
| 77 | + Include two plugins in the container: |
| 78 | + </p> |
| 79 | + <CodeBlock lang="bash"> |
| 80 | + { |
| 81 | + [ |
| 82 | + 'docker build --build-arg ETHERPAD_PLUGINS="ep_comments_page ep_author_neat" --tag <YOUR_USERNAME>/etherpad .' |
| 83 | + ].join("\n") |
| 84 | + } |
| 85 | + </CodeBlock> |
| 86 | + |
| 87 | + <DocTopHeader text="Running your instance:"/> |
| 88 | + <p className="text-white"> |
| 89 | + To run your instance: |
| 90 | + </p> |
| 91 | + <CodeBlock lang="bash"> |
| 92 | + { |
| 93 | + [ |
| 94 | + 'docker run --detach --publish <DESIRED_PORT>:9001 <YOUR_USERNAME>/etherpad' |
| 95 | + ].join("\n") |
| 96 | + } |
| 97 | + </CodeBlock> |
| 98 | + <p className="text-white"> |
| 99 | + And point your browser to <code>http://<YOUR_IP>:<DESIRED_PORT></code> |
| 100 | + </p> |
| 101 | + |
| 102 | + <DocTopHeader text="Options available by default"/> |
| 103 | + <p className="text-white"> |
| 104 | + The <code>settings.json.docker</code> available by default allows to control almost every setting via environment variables. |
| 105 | + </p> |
| 106 | + |
| 107 | + <DocTopHeader text="General"/> |
| 108 | + <p className="text-white"> |
| 109 | + <table> |
| 110 | + <thead> |
| 111 | + <tr> |
| 112 | + <th>Variable</th> |
| 113 | + <th>Description</th> |
| 114 | + <th>Default</th> |
| 115 | + </tr> |
| 116 | + </thead> |
| 117 | + <tbody> |
| 118 | + <tr> |
| 119 | + <td><code>TITLE</code></td> |
| 120 | + <td>The name of the instance</td> |
| 121 | + <td>Etherpad</td> |
| 122 | + </tr> |
| 123 | + <tr> |
| 124 | + <td><code>FAVICON</code></td> |
| 125 | + <td>favicon default name, or a fully specified URL to your own favicon</td> |
| 126 | + <td>favicon.ico</td> |
| 127 | + </tr> |
| 128 | + <tr> |
| 129 | + <td><code>DEFAULT_PAD_TEXT</code></td> |
| 130 | + <td>The default text of a pad</td> |
| 131 | + <td>Welcome to Etherpad! This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents! Get involved with Etherpad at https://etherpad.org</td> |
| 132 | + </tr> |
| 133 | + <tr> |
| 134 | + <td><code>IP</code></td> |
| 135 | + <td>IP which etherpad should bind at. Change to <code>::</code> for IPv6</td> |
| 136 | + <td><code>0.0.0.0</code></td> |
| 137 | + </tr> |
| 138 | + <tr> |
| 139 | + <td><code>PORT</code></td> |
| 140 | + <td>port which etherpad should bind at</td> |
| 141 | + <td><code>9001</code></td> |
| 142 | + </tr> |
| 143 | + <tr> |
| 144 | + <td><code>ADMIN_PASSWORD</code></td> |
| 145 | + <td>the password for the <code>admin</code> user (leave unspecified if you do not want to create it)</td> |
| 146 | + <td></td> |
| 147 | + </tr> |
| 148 | + <tr> |
| 149 | + <td><code>USER_PASSWORD</code></td> |
| 150 | + <td>the password for the first <code>user</code> (leave unspecified if you do not want to create it)</td> |
| 151 | + <td></td> |
| 152 | + </tr> |
| 153 | + </tbody> |
| 154 | + </table> |
| 155 | + |
| 156 | + |
| 157 | + <DocTopHeader text="Database"/> |
| 158 | + <table> |
| 159 | + <thead> |
| 160 | + <tr> |
| 161 | + <th>Variable</th> |
| 162 | + <th>Description</th> |
| 163 | + <th>Default</th> |
| 164 | + </tr> |
| 165 | + </thead> |
| 166 | + <tbody> |
| 167 | + <tr> |
| 168 | + <td><code>DB_TYPE</code></td> |
| 169 | + <td>a database supported by <DocLink href="https://www.npmjs.com/package/ueberdb2" |
| 170 | + children="https://www.npmjs.com/package/ueberdb2"/></td> |
| 171 | + <td>not set, thus will fall back to <code>DirtyDB</code> (please choose one instead)</td> |
| 172 | + </tr> |
| 173 | + <tr> |
| 174 | + <td><code>DB_HOST</code></td> |
| 175 | + <td>the host of the database</td> |
| 176 | + <td></td> |
| 177 | + </tr> |
| 178 | + <tr> |
| 179 | + <td><code>DB_PORT</code></td> |
| 180 | + <td>the port of the database</td> |
| 181 | + <td></td> |
| 182 | + </tr> |
| 183 | + <tr> |
| 184 | + <td><code>DB_NAME</code></td> |
| 185 | + <td>the database name</td> |
| 186 | + <td></td> |
| 187 | + </tr> |
| 188 | + <tr> |
| 189 | + <td><code>DB_USER</code></td> |
| 190 | + <td>a database user with sufficient permissions to create tables</td> |
| 191 | + <td></td> |
| 192 | + </tr> |
| 193 | + <tr> |
| 194 | + <td><code>DB_PASS</code></td> |
| 195 | + <td>the password for the database username</td> |
| 196 | + <td></td> |
| 197 | + </tr> |
| 198 | + <tr> |
| 199 | + <td><code>DB_CHARSET</code></td> |
| 200 | + <td>the character set for the tables (only required for MySQL)</td> |
| 201 | + <td></td> |
| 202 | + </tr> |
| 203 | + <tr> |
| 204 | + <td><code>DB_FILENAME</code></td> |
| 205 | + <td>in case <code>DB_TYPE</code> is DirtyDB or sqlite, the database file.</td> |
| 206 | + <td><code>var/dirty.db</code>, <code>var/etherpad.sq3</code></td> |
| 207 | + </tr> |
| 208 | + </tbody> |
| 209 | + </table> |
| 210 | + </p> |
| 211 | + <p className="text-white"> |
| 212 | + If your database needs additional settings, you will have to use a personalized settings.json.docker and rebuild the container (or otherwise put the updated settings.json inside your image). |
| 213 | + </p> |
| 214 | + <DocTopHeader text="Pad Options"/> |
| 215 | + |
| 216 | + </div> |
| 217 | +} |
0 commit comments