Separation and improvement of TYPO3 and PHP Docker Boilerplate

container photo
Photo by tsuna72
TYPO3 Docker Boilerplate forked to PHP Docker Boilerplate leading to more specialization,better customization, faster creation, development and testing – multiple PHP versions (5.3, 5.4, 5.5, 5.6) supported.

Until this weekend there only was the TYPO3 Docker Boilerplate which was now forked to PHP Docker Boilerplate.

The main reason for the fork was a better specialization of the TYPO3 Docker Boilerplate which will now focus on TYPO3 CMS. The PHP Docker Boilerplate instead will focus on general PHP development and frameworks like Symfony and CakePHP.

With this separation there were also some breaking changes:

Docker Linux distribution images

Now there are different Linux distributions available:

  • Ubuntu 12.04 – PHP 5.3, LTS (precise)
  • Ubuntu 14.04 – PHP 5.5, LTS (trusty)
  • Ubuntu 15.04 – PHP 5.6 (vivid)
  • Ubuntu 15.10 – PHP 5.6 (wily)
  • CentOS 7 – PHP 5.4

The target distribution (CentOS or Ubuntu) can be changed in docker-composer.yml and the Version of each Distribution can be changed in docker/main/DISTRIBUTION/Dockerfile.

Now you can test your PHP application with different distributions or PHP versions.

Docker Provisioning with Ansible

Provisioning of the main docker container was changed from shell scripts to Ansible playbooks which are easier to maintain and prevents common shell script issues. Ansible playbooks are using yaml based configuration which are easier to read and to customize. Also complex provisioning tasks are possible which can be pain in plain shell scripts.

The drawback of using Ansible is a much slower provisioning but IMHO shell scripts are ugly and hard to read but also this issue is solved by using prebuilt images.

Prebuilt Docker images

Because of the much slower provisioning the Docker Boilerplates now are using prebuilt Docker Boilerplate images which are build from my php-docker Dockerfiles.
The prebuilt images will include most packages including php (cli and fpm) and also Ansible for the later provisioning from the PHP Docker Boilerplate.
Now building of a PHP Docker Boilerplate takes 30 to 60 seconds instead of 10 Minutes.

If you don’t want to use the prebuilt images or you don’t trust me you can still use the official images. The Ansible provisioning will install all needed tools so the result will be the same – but much slower.

~tl/dr~

There is a TYPO3 Docker Boilerplate and a general PHP Docker Boilerplate, the provisioning was changed to Ansible and there are prebuilt Docker images available -> a faster, secure and easier provisioning.

Also different Linux distributions like CentOS and Ubuntu are available with different PHP versions.

I'm working as DevOps (software developer and linux administrator) in a TYPO3 agency in Stuttgart. I love OpenSource technologies like Linux and PHP and I'm want to share knowledge and experience.

5 Comments

    • Markus Blaschke

      2015-09-01 - 10:15 am
      Reply

      With Docker and Docker Boilerplate you can customize your services layout and also deploy this layout to your production environment which offers a very easy development and deployment strategy – you get the same environment in development and you will not have an “works for me” issues anymore 🙂
      Also if projects requires some special services (eg. Solr, Redis…) the Docker Boilerplate can be a good solution. And because it’s customizable it’s a “per project solution”.

      But for smaller TYPO3 installations TYPO3.Homestead can be a good alternative 🙂

      PS: There is also a CliTool project for some TYPO3 development workflows (eg. easy sync from production to development, automatic injecting TYPO3 backend user and manipulation of TYPO3 domain records)

  1. Hugo

    2015-10-01 - 9:03 pm
    Reply

    Hello, could you help me with this error? I using Centos 7 image

    Removing intermediate container 1f677a2b57ab
    Step 15 : RUN bash /opt/docker/bin/provision.sh bootstrap
    —> Running in 798238f1767f
    Unexpected Exception: cannot import name range

    • Hugo

      2015-10-01 - 9:50 pm
      Reply

      After a few hours managed to solve, goes to those who are having problems:

      in
      centos/bootstrap.sh
      pip install -U six
      — before
      git clone –recursive http://github.com/ansible/ansible.git /opt/ansible

Leave a Reply