Skip to content
Snippets Groups Projects
README.md 5.68 KiB

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:

  1. Get the sources of this project and build them.
  2. 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 latesttag then use the corresponding GitHub branch/tag. For example for the 8.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.
  • 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:

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.