WIP - Docker files for TYPO3 CMS
Yet another TYPO3 CMS Docker package based upon PHP and Apache. It’s simple, understandable and yet fully functional.
Suitable for development and production.
What is included?
.env
fileBase images for running TYPO3 CMS. Needed as base images for demo and project container.
Build and run a minimal production / base image:
docker-compose build
This will create the fnagel/docker-typo3-webserver
image.
Build a container with development tools (composer, xdebug, etc.):
docker-compose -f docker-compose.yml -f docker-compose.dev.yml build
This will create the fnagel/docker-typo3-webserver-dev
image.
Create images
Build and run a container with installed and fully functional introduction package:
docker-compose -f docker-compose.yml -f docker-compose.demo.yml up --build -d
or with development tools:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.demo.yml up --build -d
Setup demo
Use the following command to install the introduction package using TYPO3 console:
docker-compose exec webserver bash ./install.sh
Default domain is http://demo.typo3.local
Project requirements
composer
based TYPO3 project/web
folder for all public files (using the web-dir
directive, see composer.json in /demo
folder)How to integrate with your existing TYPO3 CMS project
.docker
sub folder of your project.env
file to your project root folder and change variables as needed
docker-compose -f .docker/docker-compose.yml -f .docker/docker-compose.project.yml up --build -d
This will:
Copy files:
Use the following command to import more static files to the volume:
docker cp ./web/folder webserver:/var/www/html/
Import database:
Use the following command to import your database:
docker-compose run db bash -c 'mysql -uroot -p"$MYSQL_ROOT_PASSWORD" -h db $MYSQL_DATABASE' < .docker/project/data/db.sql
Or with a gzip file:
docker-compose run --rm db bash -c 'gunzip | mysql -uroot -p"$MYSQL_ROOT_PASSWORD" -h db $MYSQL_DATABASE' < .docker/project/data/db.sql.gz &> /dev/null
Default values for the database connection see MYSQL_*
variables in the .env
file.
Change the DOCKER_PHP_TAG
variable in the .env
file.
Use vim /usr/local/etc/php/conf.d/custom.ini
to add or change PHP settings.
“Docker Toolbox for Windows”
@FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i
on Windowsdocker-machine rm default
anddocker-machine create -d virtualbox --virtualbox-disk-size "100000" default
“Docker for Windows WSL”
Clean up on down (unused images and volumes): docker-compose down --rmi local -v
Clean up radical (be VERY careful): docker image prune -a
Do a clean build by using: docker-compose build --no-cache
Possible errors:
ERROR: for xyz Cannot start service xyz: network 12345 not found
docker-compose up --force-recreate
ERROR: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network
Error failed to create xyz: Error response from daemon: all predefined address pools have been fully subnetted
docker network ls
docker network rm SOME_NETWORK_ID
AH00526: Syntax error on line 170 of /etc/apache2/apache2.conf: Multiple <Directory> arguments not (yet) supported.
/
from beginning of APACHE_DOCUMENT_ROOT
env variable valueDocument env file issue and workaround
Add simple docker.sh file?
APACHE_DOCUMENT_ROOT
with leading slash will add local Windows path, so we remove the /
at the beginning
bash docker.sh up
Document ftp usage
Sync folder (shared volumes) see sync
and remove-symlinks
branch -> obsolete due to bad performance
Thanks to @jzaefferer (@sloppyio) for the help getting started with docker!
Resources