Run a fresh Contao installation or contao demo within a minute.
docker-compose.yml
file. No need to checkout the repository unless you want to build your own specific versions. docker-compose.yml
. Otherwise the latest version will be used. You can find all pre build versions here docker-compose up -d
docker-compose.yml
file. No need to checkout the repository unless you want to build your own specific versions.docker-compose up -d
in your terminal and the current folderdocker exec --user www-data contao_php bash -c "php ../install-demo.php"
This setup also provides the Contao Manager. You can access it via calling http://localhost/contao-manager.php
You can use minor versions like 4.4 or 4.3 or full versions incl. bugfix releases. Minor version are built against the latest bugfix release. if you choose for example 4.3 it was built using 4.3.11.
See all pre built versions here
docker-compose down
or docker-compose down -v
. The latter one will also delete the data volume which was used. Good if you want a fresh start.The demo data prepared for contao 4 is taken from the forums Thanks to Andreas.
This setup is also perfectly suited for easily develop contao bundles. If you for example develop a bundle named "ctsmedia/test-bundle".
php:
image: ctsmedia/contao:latest
environment:
DEFAULT_PASSWORD: *password
PROJECT_NAME: *project
ports:
- "9000"
volumes:
- /var/www/share/project
- ./test-bundle:/var/www/share/test-bundle:ro
3. Connect to the container: `docker exec -it contao_php bash`
4. Add the bundle to the contao installation
4.1 `docker exec --user www-data contao_php bash -c "composer config repositories.test-bundle path ../test-bundle"`
4.2 `docker exec --user www-data contao_php bash -c "composer require cts/test-bundle:*"` (Make sure the composer.json in test-bundle folder has a version entry. otherwise it can not recognized, we use www-data so we don't get any problems with written files by postcripts)
## Building
if you want to build a specific version which is not remotely available you can do so by running:
```bash
docker build -t ctsmedia/contao:4.4.1 --build-arg CONTAO_VERSION=4.4.1 .
Full composer version constraints are allowed. You could for example to the following
docker build -t ctsmedia/contao:4-latest --build-arg CONTAO_VERSION=^4.4 .
or
docker build -t ctsmedia/contao:4.4-latest --build-arg CONTAO_VERSION=4.4.* .