Docker version of Jahia CMS installations.
|
|
|
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
This project requires :
- 🐳 Docker (minimum version 17)
- 🐋 Docker compose 3.5
New Jahia image will be based on the following official images from Docker Hub :
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 :
wait.sh: wait for MySQL to be upinstall.sh: launch Jahia installationstart.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).
ℹ️ It is also possible to use the Expect 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)
-
Get the project
git clone git@github.com:Yann39/jahia-docker.git C:\Git\jahia-docker -
Modify the docker-compose file (docker-compose.yml) to match the version of Jahia you want to run
-
Adjust settings in the corresponding installation file (passwords, e-mail addresses, etc.)
-
Start your Docker engine
-
Open a PowerShell command prompt
-
Navigate to the project root directory
cd C:\Git\jahia-docker -
Run compose up
docker-compose up -
Open a browser and reach http://localhost:8080/site (in case of 'site' context installation)
docker-compose build
(you can also use docker-compose down to remove old containers) before running again docker-compose up.
Almost the same as Windows. Do not forget to change the volumes path in the docker-compose file.
Refer to the Jahia license. Else, the GPL v3 applies.
General Public License (GPL) v3
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 http://www.gnu.org/licenses/.
