The configuration files in detail
How Dockerfile, docker-compose.yml, docker-compose.override.yml and composer.json work together, explained section by section.
How they work together
Four files describe the entire appliance. Each has a clearly defined job:
| File | Question it answers | Takes effect at |
|---|---|---|
composer.json | Which PHP packages (TYPO3, extensions) are included? | build |
Dockerfile | How are the images for PHP and nginx built? | build |
docker-compose.yml | Which containers run, with which data, variables and dependencies? | start and operation |
docker-compose.override.yml | What is different on this machine? | start and operation |
What happens on docker compose up -d --build:
- Compose reads
docker-compose.yml, mergesdocker-compose.override.ymlinto it and fills in the values from.env. - For services with
build, Docker builds theDockerfile: stageappinstalls PHP, system packages and, via Composer, all packages according tocomposer.lock. Stagewebcopies the finished files into an nginx image. - Compose starts
dbandelasticsearch. As soon as the database is healthy,phpstarts. Its entrypoint installs TYPO3 the first time, and otherwise updates the database schema, flushes the caches and syncs the search index. - Once
phpis healthy,webandschedulerstart.
This leads to the most important rule: code lives in the image, data lives in volumes. Changes to composer.json, the Dockerfile, packages/ or config/ require a rebuild. Content, uploads and backend settings survive it.
- Dockerfile One Dockerfile, two images: PHP-FPM with TYPO3 and nginx with the same files. Every instruction explained.
- docker-compose.yml Five services, shared variables and volumes, health checks and the start order.
- docker-compose.override.yml Why the Keycloak host name is redirected inside the container and how override files work.
- composer.json TYPO3 system extensions, the Keycloak integration, local packages and how updates work.