-
Vincent Massol authoredVincent Massol authored
Provides several full Docker environments for running XWiki.
The following configurations are currently supported:
- Two Docker containers with one container for running latest MySQL 5.x database (configured to use UTF8 and be case-insensitive) and another container for running the latest Tomcat 8 + Java 8 + XWiki (the version depends on the branch/tag you use).
All source files are under the LGPL 2.1 license.
Assumptions
The goal is to provide a production-ready XWiki system running in Docker. This why:
- The OS is based on Debian and not on some smaller-footprint distribution like Alpine
- Several containers are used with Docker Compose: one for the DB and another for XWiki + Servlet container. This allows the ability to run them on different machines for example.
Using
You should first install Docker on your machine.
Then there are several options:
- Get the sources of this project and build them.
- Just pull the xwiki image from DockerHub.
Pulling existing image
You need to run 2 containers:
- One for the XWiki image
- One for the database image to which XWiki connects to
The simplest is to use the Docker Compose file we provide. Run the following steps:
-
wget wget https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/master/xwiki-mysql-tomcat/docker-compose-using.yml
- if you're not using the
latest
tag then use the corresponding GitHub branch/tag. For example for the8.x
branch:wget https://raw.githubusercontent.com/xwiki-contrib/docker-xwiki/8.x/xwiki-mysql-tomcat/docker-compose-using.yml
- You can edit the compose file retrieved to change the default username/password and other environment variables.
- if you're not using the
docker-compose up
For reference here's a minimal Docker Compose file using MySQL that you could use as an example (full example here):
version: '2'
services:
web:
image: "xwiki/xwiki-mysql-tomcat:latest"
depends_on:
- db
ports:
- "8080:8080"
volumes:
- xwiki-data:/var/lib/xwiki
environment:
- MYSQL_USER=xwiki
- MYSQL_PASSWORD=xwiki
db:
image: "mysql:5"
volumes:
- ./mysql/xwiki.cnf:/etc/mysql/conf.d/xwiki.cnf
- mysql-data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=xwiki
- MYSQL_USER=xwiki
- MYSQL_PASSWORD=xwiki
- MYSQL_DATABASE=xwiki
volumes:
mysql-data: {}
xwiki-data: {}
Building
This allows you to rebuild the XWiki docker image locally. Here are the steps: