An open API service indexing awesome lists of open source software.

https://github.com/yann39/jahia-docker

Docker version of Jahia CMS installations
https://github.com/yann39/jahia-docker

docker docker-compose expect jahia

Last synced: 12 months ago
JSON representation

Docker version of Jahia CMS installations

Awesome Lists containing this project

README

          

# Jahia Docker

**Docker** version of **Jahia CMS** installations.

![Static Badge](https://img.shields.io/badge/Version-1.0.0-2AAB92)
![Static Badge](https://img.shields.io/badge/Last%20update-29%20Mar%202018-blue)

---

# Table of Contents

* [About the project](#about-the-project)
* [Technical details](#technical-details)
* [Instructions](#instructions)
* [Windows](#windows)
* [Mac/Linux](#maclinux)
* [License](#license)

# About the project



Docker logo


Jahia logo

The purpose of this project is to provide some "ready to use" Jahia installations using Docker.

It currently provides the following versions :
- Digital Experience Manager Enterprise Distribution **7.1.2.1**
- Digital Experience Manager Enterprise Distribution **7.2.2.0**

# Technical details

This project requires :
- :whale: Docker (minimum version 17)
- :whale2: Docker compose 3.5

New Jahia image will be based on the following official images from **Docker Hub** :
- [Centos 6](https://hub.docker.com/_/centos/)
- [MySQL 5.6](https://hub.docker.com/_/mysql/)

When running the _docker-compose_ file, it will create 2 images :
- `jahia-x.x.x.x_mysql` : MySQL image (pulled from Docker Hub)
- `jahia-x.x.x.x_tomcat` : Jahia Tomcat image (created from the related Dockerfile)

The MySQL image is simply pulled from Docker Hub if it does not exist. We add an alternative _my.cnf_ file on start
because Jahia requires a higher `max_allowed_packet`. If not set, an error is thrown during the installation :

> Value for max_allowed_packet is not enough, should be at least 100M

The Jahia image is created from its **Dockerfile**, it just prepares the server for the Jahia installation, it will
**not** be installed at build time!

Indeed, installation process requires the MySQL database to be up, so the installation cannot be done on image build but
has to be done on container run. Therefore, a test is done on container start to check if Jahia is already installed,
and install it only if needed.

3 Shell scripts are executed when running this container from the compose file, in the following order :
1. `wait.sh` : wait for MySQL to be up
2. `install.sh` : launch Jahia installation
3. `start.sh` : start Jahia

The Jahia installation process is automated using an automatic installation script (**IzPack** XML file), it is passed
as argument in the compose file (that file can be generated by running a fake Jahia installation on another machine
using the GUI, then click "_Generate an automatic installation script_" at the end of the installation process).

:information_source: It is also possible to use the [Expect](https://core.tcl.tk/expect/index) library to automate user
input. I used it on first try and kept the _.exp_ file just in case... To use it just add the required dependency
(`expect.x86_64`) in the Jahia Dockerfile, adjust the `CONF_FILE` parameter in the docker-compose file and run
`expect /tmp/configuration.exp` in the _install.sh_ script instead of directly executing the JAR file).

Modules from the _modules_ folder will automatically be deployed.

Tomcat is executed with **JPDA** support, so it can be directly debugged from your local IDE.

Finally, you should end up with 2 running containers :
- `jahia-x.x.x.x_mysql` : MySQL container listening on port **3306** (exposed as 3306)
- `jahia-x.x.x.x_tomcat` : Jahia container with Tomcat listening on port **8080** (exposed as 8080)

# Instructions

## Windows

1. Get the project

`git clone git@github.com:Yann39/jahia-docker.git C:\Git\jahia-docker`

2. Modify the **docker-compose** file (_docker-compose.yml_) to match the version of Jahia you want to run
3. Adjust settings in the corresponding installation file (passwords, e-mail addresses, etc.)
4. Start your Docker engine
5. Open a **PowerShell** command prompt
6. Navigate to the project root directory

`cd C:\Git\jahia-docker`

7. Run compose up

`docker-compose up`

8. Open a browser and reach http://localhost:8080/site (in case of 'site' context installation)

:warning: Once the images exist, if you change a configuration then you will have to rebuild the images using `docker-compose build`
(you can also use `docker-compose down` to remove old containers) before running again `docker-compose up`.

## Mac/Linux

Almost the same as Windows.
Do not forget to change the volumes path in the _docker-compose_ file.

# License

Refer to the [Jahia](https://www.jahia.com) license. Else, the GPL v3 applies.

[General Public License (GPL) v3](https://www.gnu.org/licenses/gpl-3.0.en.html)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not,
see .