tp3/docker
TYPO3 docker testing image - This image is part of an automated testing enviroment.
Webservice can be linked to MySQL. More about the automated testing
https://bitbucket.org/web-tp3/tp3_installer, (*1)
Usage (standalone)
This image needs an external MySQL server or linked MySQL container. To create a MySQL container:, (*2)
docker run -d -e MYSQL_ROOT_PASSWORD="my-secret-pw" --name db -p 3306:3306 webtp3/tp3sql
To run TYPO3 by linking to the database created above:, (*3)
docker run -d --link db:db -e DB_PASS="<your_password>" -p 80:80 webtp3/docker:16.4-stable
Following branches are available:
8-stable (with typo3 installed)
16.4-stable (just apache and php 7.1 - waiting for install in /var/www/html)
18.4-stable (just apache and php 7.2 - waiting for install in /var/www/html), (*4)
docker cp typo3 /from/ /to/ (Copy files/folders between a container and the local filesystem)
Usage (combined)
ia docker stack deploy or docker-compose, (*5)
docker-compose -f docker-compose.yml up
Now, you can use your web browser to access TYPO3 from the the follow address:, (*6)
http://localhost/typo3
User is "tp3min" and password is "Init1111"., (*7)
The mysql Adminer, (*8)
http://localhost:8080
Mysql Server can also be reached from outside on port 3306, (*9)
SSH Server also for Rsync and other stuff
to use ssh server there is a user typo3user that needs a password (docker exec...)
graphicsmagick, imagemagick, letscrypt, openssl, php-xdebug and I think all what you need., (*10)
start the server
You can easyly create your ohne Docker file based on this installation and deploy your app to it
Create a Dockerfile like the following:, (*11)
FROM webtp3/docker:18.4-stable
RUN apt-get update && apt-get install -yq
ADD . /var/www/html
# start composer install
RUN composer config repositories.local path 'Packages/*' -d /var/www/html/
RUN omposer --dev update -d /var/www/html/
# Expose environment variables for automated setup
ENV DB_HOST **LinkMe**
ENV DB_PORT **LinkMe**
ENV DB_NAME typo3
ENV DB_USER root
ENV DB_PASS my-secret-pw
ENV INSTALL_TOOL_PASSWORD password
#serverroot is in /var/www/html/web we use the vendor dir for that
# for productive enviroment we recommend to ouse the flag --no-dev
next is if you have docker installed you run in the root of your Projekt, (*12)
docker build -t yourtest .
docker run -d -e MYSQL_ROOT_PASSWORD="my-secret-pw" --name db -p 3306:3306 webtp3/tp3sql
docker run -d --rm -it -v $PWD:/build --link db:db -e DB_PASS="my-secret-pw" -p 80:80 --name typo3 yourtest
#### start testing, (*13)
docker exec typo3 php vendor/phpunit/phpunit/phpunit --configuration web/typo3conf/ext/cag_tests/Tests/Build/UnitTests.xml --teamcity --log-junit
docker exec typo3 php vendor/phpunit/phpunit/phpunit --configuration web/typo3conf/ext/cag_tests/Tests/Build/UnitTestsDeprecated.xml --teamcity --log-junit
docker exec typo3 php vendor/phpunit/phpunit/phpunit --configuration web/typo3conf/ext/cag_tests/Tests/Build/FunctionalTests.xml --teamcity --log-junit
docker exec typo3 mkdir -p web/typo3temp/var/tests
docker exec typo3 vendor/bin/chromedriver --url-base=/wd/hub >/dev/null 2>&1 &
docker exec typo3 php -S 0.0.0.0:8000 >/dev/null 2>&1 &
docker exec typo3 sleep 3;
docker exec typo3 typo3DatabaseName='typo3' typo3DatabaseHost='DB' typo3DatabaseUsername='root' typo3DatabasePassword='my-secret-pw' vendor/codeception/codeception/codecept run Acceptance -c web/typo3conf/ext/cag_tests/Tests/Build/AcceptanceTests.yml
docker stop typo3
docker stop db
by changing "my-secret-pw" you change the passwords of the systems, (*14)
install typo3 via cli, (*15)
docker exec typo3 bash /var/www/cgi-bin/run-typo3.sh
Documentation
more about the base images an be found on the docker hub:, (*16)
https://hub.docker.com/r/webtp3/docker, (*17)
https://github.com/webtp3/docker, (*18)
The System runs with a php fastcgi wrapper. So you can easyly swap php Versions to tests on several ons., (*19)
The mysql Adminer, (*20)
http://localhost:8080
Mysql Server can also be reached from outside on port 3306, (*21)
SSH Server also for Rsync and other stuff
to use ssh server there is a user typo3user that needs a password (docker exec...)
graphicsmagick, imagemagick, letscrypt, openssl, php-xdebug and I think all what you need., (*22)
switch php
docker exec typo3 rm /etc/alternatives/php
docker exec typo3 ln -s /usr/bin/php7.1 /etc/alternatives/php
docker exec typo3 php -v
PHP 7.1.19-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jul 9 2018 13:12:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.19-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans, (*23)
start the server
You can easyly create your ohne Docker file based on this installation and deploy your app to it
Create a Dockerfile like the following:, (*24)
FROM webtp3/docker:16.4-stable
RUN apt-get update && apt-get install -yq
ADD . /var/www/html
# start composer install
RUN composer config repositories.local path 'Packages/*' -d /var/www/html/
RUN composer --dev install -d /var/www/html/
# Expose environment variables for automated setup
ENV DB_HOST **LinkMe**
ENV DB_PORT **LinkMe**
ENV DB_NAME typo3
ENV DB_USER root
ENV DB_PASS my-secret-pw
ENV INSTALL_TOOL_PASSWORD password
#serverroot is in /var/www/html/web we use the vendor dir for that
# for productive enviroment we recommend to ouse the flag --no-dev
next is if you have docker installed you run in the root of your Projekt, (*25)
docker -t yourtest build .
docker run -d -e MYSQL_ROOT_PASSWORD="my-secret-pw" --name db -p 3306:3306 webtp3/tp3sql
docker run -d --rm -it -v $PWD:/build --link db:db -e DB_PASS="my-secret-pw" -p 80:80 --name typo3 yourtest
#### start testing, (*26)
docker exec typo3 php vendor/phpunit/phpunit/phpunit --configuration web/typo3conf/ext/cag_tests/Tests/Build/UnitTests.xml --teamcity --log-junit
docker exec typo3 php vendor/phpunit/phpunit/phpunit --configuration web/typo3conf/ext/cag_tests/Tests/Build/UnitTestsDeprecated.xml --teamcity --log-junit
docker exec typo3 php vendor/phpunit/phpunit/phpunit --configuration web/typo3conf/ext/cag_tests/Tests/Build/FunctionalTests.xml --teamcity --log-junit
docker exec typo3 mkdir -p web/typo3temp/var/tests
docker exec typo3 vendor/bin/chromedriver --url-base=/wd/hub >/dev/null 2>&1 &
docker exec typo3 php -S 0.0.0.0:8000 >/dev/null 2>&1 &
docker exec typo3 sleep 3;
docker exec typo3 typo3DatabaseName='typo3' typo3DatabaseHost='DB' typo3DatabaseUsername='root' typo3DatabasePassword='my-secret-pw' vendor/codeception/codeception/codecept run Acceptance -c web/typo3conf/ext/cag_tests/Tests/Build/AcceptanceTests.yml
docker stop typo3
docker stop db
by changing "my-secret-pw" you change the passwords of the systems, (*27)
install typo3 via cli, (*28)
docker exec typo3 bash /var/www/cgi-bin/run-typo3.sh
Documentation
more about the base images an be found on the docker hub:, (*29)
https://hub.docker.com/r/webtp3/docker, (*30)
https://github.com/webtp3/docker, (*31)
The System runs with a php fastcgi wrapper. So you can easyly swap php Versions to tests on several ons., (*32)
docker exec typo3 rm /etc/alternatives/php
docker exec typo3 ln -s /usr/bin/php7.1 /etc/alternatives/php
# alternatives
php -> /etc/alternatives/php (7.0)
php-cgi -> /etc/alternatives/php-cgi
php-cgi7.1
php7.1
php7.2
Web Server
https://hub.docker.com/_/ubuntu/, (*33)
Database Server
https://hub.docker.com/_/mysql/, (*34)