You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xwiki/README.md
+145Lines changed: 145 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -241,6 +241,142 @@ volumes:
241
241
xwiki-data: {}
242
242
```
243
243
244
+
### Using Docker Swarm
245
+
246
+
Here are some examples of using this image with Docker Swarm. These examples leverage additional features of Docker Swarm such as Docker secrets, and Docker configs. As such, these examples require Docker to be in swarm mode.
247
+
248
+
You can read more about these features and Docker swarm mode here:
This example presupposes the existence of the Docker secrets `xwiki-db-username`, `xwiki-db-password` and `xwiki-db-root-password`, and the Docker config `xwiki-mysql-config`.
257
+
258
+
You can create these secrets and configs with the following:
This allows you to rebuild the XWiki docker image locally. Here are the steps:
@@ -280,6 +416,15 @@ The first time you create a container out of the xwiki image, a shell script (`/
280
416
- `DB_DATABASE`: The name of the XWiki database to use/create.
281
417
- `DB_HOST`: The name of the host (or docker container) containing the database. Default is "db".
282
418
419
+
In order to support [Docker secrets](https://docs.docker.com/engine/swarm/secrets/), the configuration values can also be given to the container as files containing that value.
420
+
421
+
- `DB_USER_FILE`: The location, inside the container, of a file containing the value for `DB_USER`
422
+
- `DB_PASSWORD_FILE`: The location, inside the container, of a file containing the value for `DB_PASSWORD`
423
+
- `DB_DATABASE_FILE`: The location, inside the container, of a file containing the value for `DB_DATABASE`
424
+
- `DB_HOST_FILE`: The location, inside the container, of a file containing the value for `DB_HOST`
425
+
426
+
*Note:* For each configuration value, the normal environment variable and \_FILE environment variable are mutually exclusive. Providing values for both variables will result in an error.
427
+
283
428
The main XWiki configuration files (`xwiki.cfg`, `xwiki.properties` and `hibernate.cfg.xml`) are available in the mapped local directory for the permanent directory on your host.
284
429
285
430
If you need to perform some advanced configuration, you can execute another container and attach to the running XWiki container by issuing (but note that these won't be saved if you remove the container):
0 commit comments