Preamble
This container bundle provides two/three containers to run your TYPO3 websites with docker. It should also be scalable in case of using things like kubernetes e.g. with AWS.
Source code and issue tickets
Found an issue? Feel free to create an issue ticket and/or a merge request or if you don´t wan´t to register on GitHub you can send me a mail via contact form.
You can find the source code of all container on GitHub.
typo3-apachetypo3-phptypo3-utilities
TYPO3 and PHP version matrix
This table can be used for the containers "kronova/typo3-php" and "kronova-typo3-utilities"
Image Tag | PHP Version | Supported TYPO3 Versions |
---|---|---|
php-8.0 | 8.0.x | 11.5 |
latest, php-7.4 | 7.4.x | 8.7, 9.5, 10.4, 11.5 |
php-7.3 | 7.3.x | 8.7, 9.5, 10.4 |
php-7.2 | 7.2.x | 8.7, 9.5, 10.4 |
Links to dockerhub
Settings for typo3-apache container
The following things can be configured using environment variables e.g. in your docker-compose file
Environment variable | default value | description |
---|---|---|
DOCUMENT_ROOT | /usr/local/apache2/htdocs/public | The entrypoint of your website. Default for composer based projects. |
SERVER_ADMIN | pleaseSetTheEnvironment@variable.tld | Contact mail that will be displayed in some apache error messages. See here |
Settings for typo3-utilities container
The following things can be configured using environment variables e.g. in your docker-compose file
Environment variable | default value | description |
---|---|---|
DOCUMENT_ROOT | same as typo3-apache | If you customize this setting on the typo3-apache container then you also need to set the same value for typo3-utilities container! See here |
START_SSH_SERVER | true | Starts an openssh server on port 22 if set to true. Put your public key into /home/typo3/.ssh/authorized_keys |
Example docker-compose
version: '3.7'
services:
web:
container_name: mywebsite_web
depends_on:
- db
environment:
- PHP_SERVICE_NAME=mywebsite_utilities
image: kronova/typo3-apache
networks:
- private
- web
ports:
- 80:80
restart: always
volumes:
- htdocs:/usr/local/apache2/htdocs:ro
utilities:
container_name: mywebsite_utilities
depends_on:
- db
image: kronova/typo3-utilities
networks:
- private
ports:
- "2222:22"
restart: always
volumes:
- htdocs:/usr/local/apache2/htdocs
- ssh:/home/typo3/.ssh
db:
container_name: mywebsite_db
command:
- --character-set-server=utf8
- --collation-server=utf8_unicode_ci
environment:
- MYSQL_USER=typo3
- MYSQL_PASSWORD=badPasswordChangeIt
- MYSQL_DATABASE=typo3
- MYSQL_ROOT_PASSWORD=veryBadForRoot
image: mariadb:10.4
networks:
- private
restart: always
volumes:
- mysql:/var/lib/mysql
networks:
private:
web:
external: true
volumes:
htdocs:
mysql:
ssh:
Example docker-compose with traefik labels
Take a look into this example if you´re using traefik as proxy.
version: '3.7'
services:
web:
container_name: mywebsite_web
depends_on:
- db
environment:
- PHP_SERVICE_NAME=mywebsite_utilities
image: kronova/typo3-apache
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.basic.frontend.rule=Host:domain.tld"
- "traefik.basic.port=80"
- "traefik.basic.protocol=http"
networks:
- private
- web
restart: always
volumes:
- htdocs:/usr/local/apache2/htdocs:ro
utilities:
container_name: mywebsite_utilities
depends_on:
- db
image: kronova/typo3-utilities
networks:
- private
ports:
- "2222:22"
restart: always
volumes:
- htdocs:/usr/local/apache2/htdocs
- ssh:/home/typo3/.ssh
db:
container_name: mywebsite_db
command:
- --character-set-server=utf8
- --collation-server=utf8_unicode_ci
environment:
- MYSQL_USER=typo3
- MYSQL_PASSWORD=badPasswordChangeIt
- MYSQL_DATABASE=typo3
- MYSQL_ROOT_PASSWORD=veryBadForRoot
image: mariadb:10.4
networks:
- private
restart: always
volumes:
- mysql:/var/lib/mysql
networks:
private:
web:
external: true
volumes:
htdocs:
mysql:
ssh:
Use TYPO3 scheduler
Install crontab on your host and add the following lines to your crontab configuration using crontab -e:
Examples:
TYPO3 without composer:
*/5 * * * * docker exec -u typo3 mywebsite_utilities /usr/local/apache2/htdocs/typo3/sysext/core/bin/typo3 scheduler:run
TYPO3 with composer:
*/5 * * * * docker exec -u typo3 mywebsite_utilities /usr/local/apache2/htdocs/typo3/public/sysext/core/bin/typo3 scheduler:run
TYPO3 with composer and surf deployment:
*/5 * * * * docker exec -u typo3 mywebsite_utilities /usr/local/apache2/htdocs/releases/current/web/typo3/sysext/core/bin/typo3 scheduler:run
TYPO3 with composer and deployer deployment:
*/5 * * * * docker exec -u typo3 mywebsite_utilities /usr/local/apache2/htdocs/current/public/typo3/sysext/core/bin/typo3 scheduler:run
To-do
- Make a list of available tools and add them to this page (e.g. deployer, surf)
- Add examples how to use TYPO3 scheduler
- Label containers by TYPO3 version for long time compatibility with older versions
Feel free to give feedback :)