This Repo gives a simple example of how you can get Typo3 running on Lagoon.
This README assumes that you are already familiar with Typo3, and will work to point out the differences/requirements when running on Lagoon.
This example contains the following services:
- Typo3
- PHP 8.3
- NGINX
- MySQL 8.0
./.lagoon.yml
- This file contains the configuration needed to make the local docker compose stack work in Lagoon
In this example we're assuming we're running with a MySQL database.
As such, if you look in the config/system/additional.php
and config/system/lagoon.additional.php
files you'll note that we dynamically set the MySQL details.
The following guides assume a "develop local, push to production" strategy.
To build the containers, run the docker commands below to get a running local stack with a local install of typo3.
docker compose build
docker compose up -d
docker compose exec cli bash -c "composer install"
docker compose exec cli bash -c "typo3 setup"
Note that the database credentials are prepopulated via variables to avoid any complications in configuring them.
In order to utilise the DDEV Lagoon provider for local development run the DDEV commands below to get a running local stack with a local install of typo3.
ddev start
ddev exec "composer install"
ddev exec "typo3 setup"
Note that the database credentials are prepopulated via variables to avoid any complications in configuring them.
Once the above steps have been completed, note that there will be changes to the settings.php file - these are storing the database configuration (usually overridden by lagoon.additional.php) and any admin user config.
You should commit these changes to git, as this config will be used to build your site in Lagoon.
The git config will trigger a build in Lagoon, assuming your project has been correctly configured - this site will have an empty database, and the admin user configured in settings.php, but you will not be able to log in to it yet.
In order to get your local site database (config, pages etc) and files (images, documents, uploads etc) to the Lagoon site, you will need to synchronise the content. These commands will sync the database and files from "local" to the specified environment in Lagoon.
Note that you'll need SSH access running in the containers, either via pygmy or another Docker Compose method.
docker compose exec cli bash
lagoon-sync sync mariadb -p {project-name} -t {environment-name} -e local
lagoon-sync sync files -p {project-name} -t {environment-name} -e local
In order to get your local site database (config, pages etc) and files (images, documents, uploads etc) to the Lagoon site, you will need to synchronise the content. These commands will sync the database and files from "local" to the specified environment in Lagoon.
ddev auth ssh
ddev push lagoon
In order to synchronise your local database/files with the Lagoon site, you will need to perform "pulls"
To do this, either in Docker Compose or DDEV, perform the following.
docker compose exec cli bash
lagoon-sync sync mariadb -p {project-name} -e {environment-name} -t local
lagoon-sync sync files -p {project-name} -e {environment-name} -t local
or
ddev auth ssh
ddev pull lagoon
To install modules using Composer, perform the following
docker compose exec cli bash -c "composer require {typo3_package}:{version}"
or
ddev composer require "{typo3_package}:{version}"
Note that this will update the composer.json and composer.lock files in your repo. You will need to Git commit and push them up to Lagoon prior to being able to use them.