Find the Exponential Software extensions you want
UNIX name | Owner | Status |
---|---|---|
ezpublish-docker | eZ Publish Legacy | stable |
Version | Compatible with |
---|---|
N/A | N/A |
Project is work in progress!
Aims to provide setup for eZ Platform(also implies eZ Studio) using Docker containers and Docker Compose, either natively on linux if you have docker and docker-compose installed, or via VM using Vagrant and Virtualbox/AWS.
Note: The use of Vagrant will probably be faded out in favour of Docker Machine in the future.
Two things:
The docker-compose setups aims to cover specific setups.
And the aim is that the yml files can easily be customized to change version to test for QA/Support/Reproduction needs.
With this everything should be in place for easily evaluating adding postgres cluster support, adding redis support,
shared files system for scalability testing, and much more..
The containers can be created and started using either vagrant or docker-compose. Vagrant will create a virtual machine where the containers are running while docker-compose will create the containers on host ( requires linux....)
By default, the following system will be installed:
Note : If you opt not to copy the configurations files mentioned above ( the *.-EXAMPLE files ), the system will do so for you and use default settings.
If you want to use an elastic IP you need version 0.5.1 of the vagrant-aws plugin ( currently in development ). The easiest way to do this is to use the provided container.
You may also use this container if you simply do not want to install vagrant on your system.
In order to create the container image, run :
docker build --rm=true --force-rm=true -t ezpublishdocker_vagrantaws:latest dockerfiles/internal/vagrant-aws/
In order to use this image, use the vagrant wrapper instead of using the vagrant installed directly on your system:
./vagrant-aws.sh [vagrant options]
Example #1:
./vagrant-aws.sh up --provider=aws
Example #2:
./vagrant-aws.sh up provision
As you can see, the wrapper will pass on any provided parameters to the vagrant process inside the container.
If you later want to do changes to your docker/vagrant files, you need to stop and remove the corresponding container docker stop [containerid]; docker rm [containerid], remove the image docker rmi [imageid] and then run vagrant provision instead of vagrant up
When using virtualbox as provisioner, vagrant provision will not rsync your local changes over to the VM. Only a vagrant upwill do that.
When using AWS as provisioner, vagrant provision will run rsync. This is likely NOT the behaviour you want as this will overwrite db and ezpublish volumes on AWS machine every time you provision.
To prevent this from happening when provisioning on AWS, use the setting "disable_rsync: yes" in vagrant.yml
If you do changes in configuration files or docker files you may run this commands in order to sync them the VM:
cd ezpublish-docker
rsync -avq --delete --exclude ".git/" --exclude "volumes/ezpublish/.git/" --exclude ".vagrant" --exclude volumes . core@1.2.3.4:/vagrant
where "1.2.3.4" is the IP if the virtual machine
Please note that running vagrant rsyncwill also delete any volumes in VM and instead copy over those you have locally
If you later just want to recreate specific images or containers, you then first remove those using docker rm [container] and docker rmi [image], and then run
./docker-compose.sh up -d --no-recreate
build.sh will build the "service" images you need in order to run eZ Platform. By "service" image we mean the nginx and php images. No customized db image is currently needed as the official MariaDB docker image is used.
docker-compose_ezpinstall.sh is a script which will download eZ Platform via composer and install it in volumes/ezpublish. You may specify parameters to composer using EZ_COMPOSERPARAM variable in files/docker-compose.config.
docker-compose_ezpinstall.sh will automaticly by run when running vagrant up and vagrant provision.
docker-compose.sh is a wrapper for docker-compose which also do some internal provisioning. Any command line arguments (except "-c configfile" ) used when starting the wrapper is passed on to docker-compose.
docker-compose.sh also accepts one special argument for specifying a alternative configuration file ( files/docker-compose.config is the default one if "-c ..." is not provided ).
Example :
docker-compose.sh --custom-conf files/my_custom_docker-compose.config up -d --no-recreate
When the containers are created, you should be able to browse to eZ Platform setup wizard by going to http://[VM_IP_ADDR]:8080/ if using vagrant and http://localhost:8080/ if running the containers on localhost
It is possible to setup a fresh installation using the install script instead of using the setup wizard. ( If using vagrant, this is done automaticly )
FYI : The command above assumes you have SYMFONY_ENV=prod in files/docker-compose.config. If you use a different setting, adjust the --env=.... parameter accordingly.
You may also substitute "demo" with "demo_clean" if you want to install ezdemo without demo data, or "clean" if only want the very basics.
These are the steps needed in order to get varnish running
To enter virtual machine:
From there you can check running containers:
And inspect the eZ Publish folder which was rsynced into the vm and is used as volume for ezpublishvol container:
To run php/mysql commands you'll need to start a new container which contains php-cli:
If running the containers on localhost, you have to skip the vagrant ssh of course
From there you can run symfony commands like normal:
You can also access mysql from this container as it has the mysql client installed:
Mysql password is defined in files/docker-compose.config
( For other environment variables see env, basically these typically comes from parent images and links )
To get out, type exit two times ;)
It is possible to run this from Windows. However, it is not possible to use synced_folder with type virtualbox (seems to be some incompatibility between virtualbox and docker's provision plugin in Vagrant or between CoreOS and Vagrant ? )
So, you need to use rsync on Windows too. In order to do this, you need rsync and ssh.
Easiest way to accomplish this is to install MinGW ( minimalist GNU for Windows ), http://sourceforge.net/projects/mingw/files/MSYS/Extension/rsync/rsync-3.0.8-1/
Download wingw-get-setup.exe and install openssh and rsync. You should then add "C:\MinGW\msys\1.0\bin" to your path and you should be all set to run "vagrant up"
If you have issues getting ssh keys to work with MinGW, this is how to fix that:
C:\> cd C:\MinGW\msys\1.0
C:\> mkdir home\vl\.ssh
Substitute 'C:\MinGW\msys\1.0' with your actuall MinGW installation directory.
Make a config file ( recommended, but not strictly speaking )
cp files/docker-compose.config-EXAMPLE files/docker-compose.config
Make a vagrant config file
cp files/vagrant.yml-EXAMPLE to files/vagrant.yml
Start vagrant
vagrant up
Access the eZ Platform installation.
Access the installation using the url http://33.33.33.53/
Make a config file ( recommended, but not strictly speaking needed )
cp files/docker-compose.config-EXAMPLE files/docker-compose.config
Create the service images ( web and php images )
./build.sh
Install eZ Platform/Studio:
./docker-compose_ezpinstall.sh
Create the containers needed for running eZ Platform/Studio
./docker-compose.sh up -d --no-recreate
Run the install script
docker-compose -f docker-compose.yml run --rm -u ez phpfpm1 /bin/bash -c "php app/console ezplatform:install demo; php app/console cache:clear --env=prod"
Stop the containers:
docker-compose -f docker-compose.yml stop
Remove the containers:
docker-compose -f docker-compose.yml rm -v; docker-compose -f docker-compose_ezpinstall.yml rm -v
Remove the images:
docker rmi ezsystems/web ezsystems/ezphp ezsystems/ezphp:5.6
Remove the eZ Platform files:
sudo rm -rf volumes/ezpublish/* volumes/mysql/*; sudo rm volumes/ezpublish/.travis.yml volumes/ezpublish/.gitignore
Make a config file ( recommended, but not strictly speaking needed )
cp files/docker-compose.config-EXAMPLE files/docker-compose.config
Make sure you have the following setting in files/docker-compose.config:
EZ_COMPOSERPARAM="--prefer-dist --repository-url=https://updates.ez.no/ttl ezsystems/ezpublish-community /var/www ~5.4.0"
Create the service images ( web and php images )
./build.sh
Install eZ Platform/Studio:
./docker-compose_ezpinstall.sh -f docker-compose_ezpinstall_php5.yml
Create the containers needed for running eZ Platform/Studio using php5 container instead of php7
./docker-compose.sh -f docker-compose_ezp54.yml -f docker-compose_php5.yml up -d --no-recreate
Stop the containers:
docker-compose -f docker-compose_ezp54.yml -f docker-compose_php5.yml stop
Remove the containers:
docker-compose -f docker-compose_ezp54.yml -f docker-compose_php5.yml rm -v; docker-compose -f docker-compose_ezpinstall.yml -f docker-compose_php5.yml rm -v
Remove the images:
docker rmi ezsystems/web ezsystems/ezphp ezsystems/ezphp:5.6
Remove the eZ Platform files:
sudo rm -rf volumes/ezpublish/* volumes/mysql/*; sudo rm volumes/ezpublish/.travis.yml volumes/ezpublish/.gitignore
Make a config file
cp files/distro_containers.config-EXAMPLE files/distro_containers.config
Create the service images ( web, db and php images )
./build.sh
Create the containers
./create_distro_containers.sh
Start the containers
source files/docker-compose.config; docker-compose -f docker-compose_services.yml up -d --no-recreate
Remove all the containers
docker-compose -f docker-compose_services.yml stop; docker-compose -f docker-compose_services.yml rm -v
./create_distro_containers.sh --cleanup
Make a config file
cp files/distro_containers.config-EXAMPLE files/distro_containers.config
Configure EZ_COMPOSERPARAM without --no-dev option (as behat is dev package), example:
EZ_COMPOSERPARAM="--prefer-source --no-progress --no-interaction ezsystems/ezplatform /var/www dev-master"
Make docker-compose file for behat (step is temporary until we start to use docker compose extend features):
cat docker-compose.yml docker-compose_behat.yml.template > docker-compose_behat.yml
Create the service images ( web and php images )
./build.sh
Install eZ Platform/Studio (Step uses what you specified in EZ_COMPOSERPARAM):
./docker-compose_ezpinstall.sh
Create the containers needed for running eZ Platform/Studio
./docker-compose.sh -f docker-compose_behat.yml up -d --no-recreate
Run the eZ Platform/Studio install script, example:
docker-compose -f docker-compose_behat.yml run -u ez --rm phpfpm1 /bin/bash -c "php app/console ezplatform:install demo; php app/console cache:clear --env=prod"
Run behat tests, example:
./docker-compose.sh -f docker-compose_behat.yml run --rm behatphpcli bin/behat --no-colors --profile demo --suite content
If you need to see what is going on in the browser being used by selenium, this is how:
Make a config file ( recommended, but not strictly speaking )
cp files/docker-compose.config-EXAMPLE files/docker-compose.config
Make docker-compose file for solr:
cat docker-compose.yml docker-compose_solr.yml.template > docker-compose_solr.yml
Enable solr link for phpfpm1 service
Edit docker-compose_solr.yml and uncomment # - solr1:solr in the phpfpm1: section.
Create the service images ( web and php images )
./build.sh
Install eZ Platform/Studio:
./docker-compose_ezpinstall.sh
Create the containers needed for running eZ Platform/Studio
./docker-compose.sh -f docker-compose_solr.yml up -d --no-recreate
Run the install script
docker-compose -f docker-compose_solr.yml run -u ez --rm phpfpm1 /bin/bash -c "php app/console ezplatform:install demo; php app/console cache:clear --env=prod"