Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ddev documentation #1356

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2e7d50a
[Task] Update ddev documentation
Mar 3, 2024
2662547
[Task] add timezone to config parameter
Jul 23, 2024
7266e7e
[Task] update MAILER_DSN for Mailpit
Jul 23, 2024
2dab368
[Task] update en translation
Jul 23, 2024
cb022b1
[Task] remove setup examples
Jul 23, 2024
ee45137
Update docs/manual/guides/local-installation/ddev.de.md
avhulst Jul 24, 2024
8c06576
Update docs/manual/guides/local-installation/ddev.en.md
avhulst Jul 24, 2024
6eca166
Update docs/manual/guides/local-installation/ddev.en.md
avhulst Jul 24, 2024
f4169e6
[Task] Fix typo
Jul 24, 2024
1850400
[Task] add Custom PHP Configuration
Jul 24, 2024
391278a
Update docs/manual/guides/local-installation/ddev.de.md
avhulst Jul 25, 2024
3e7d78f
Update docs/manual/guides/local-installation/ddev.en.md
avhulst Jul 25, 2024
c9862d0
Update docs/manual/guides/local-installation/ddev.en.md
avhulst Jul 25, 2024
20aa470
Update docs/manual/guides/local-installation/ddev.de.md
avhulst Jul 25, 2024
ec6d8de
Update docs/manual/guides/local-installation/ddev.de.md
avhulst Jul 25, 2024
751a94e
Update docs/manual/guides/local-installation/ddev.de.md
avhulst Jul 25, 2024
f1bb15e
Update docs/manual/guides/local-installation/ddev.de.md
avhulst Jul 25, 2024
0ba1b02
Update docs/manual/guides/local-installation/ddev.en.md
avhulst Jul 25, 2024
5652271
Update docs/manual/guides/local-installation/ddev.en.md
avhulst Jul 25, 2024
28c8799
Update docs/manual/guides/local-installation/ddev.de.md
avhulst Jul 25, 2024
15b5d99
Merge branch 'main' into feature/ddev-local-installation-update
avhulst Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 38 additions & 81 deletions docs/manual/guides/local-installation/ddev.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,122 +26,89 @@ mehr Informationen zur Installation dieser Programme durchlesen.

DDEV ist für alle Plattformen verfügbar, für die Installation deiner Plattform schau bitte in der [DDEV Dokumentation](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/) nach.

## Projekt erstellen

### Beispiel: Die Installation unter macOS mit __brew__ durchführen

```shell
brew install ddev/ddev/ddev
```

Nach der Installation noch die lokalen SSL-Zertifikate installieren (im Anschluss Browser neu starten).
Öffne die Konsole deiner Wahl, erstelle das gewünschte Verzeichnis und wechsle danach in ebendieses. Der Verzeichnisname spiegelt den späteren Projekt Hostnamen. Du kannst dies jedoch zusätzlich [konfigurieren](https://ddev.readthedocs.io/en/latest/users/extend/additional-hostnames/).

```shell
mkcert -install
mkdir -p ~/Projekte/contao/contao-ddev && cd ~/Projekte/contao/contao-ddev
```

Seine Installation sollte man auch regelmäßig updaten.
DDEV-Konfiguration anlegen mit:

```shell
brew upgrade ddev
ddev config --project-type=php --docroot=public --webserver-type=apache-fpm --php-version=8.2 --create-docroot --timezone=Europe/Berlin
```


### Beispiel: Installation unter Debian/Ubuntu
Contao 5.3 installieren:

```shell
curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null

echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list

sudo apt update && sudo apt install -y ddev
ddev composer create contao/managed-edition:5.3
```

Evtl. nach der Installation noch die lokalen SSL-Zertifikate installieren (im Anschluss Browser neu starten).
Nach der Installation müssen die Datenbankzugangsdaten in die `.env.local` eingetragen werden. In diesem Zug richten wir auch direkt Mailpit ein.

```shell
mkcert -install
```env
APP_ENV=prod
DATABASE_URL=mysql://db:db@db:3306/db
MAILER_DSN=smtp://localhost:1025
```

Installation updaten
Im Anschluss die Datenbank anlegen:

```shell
sudo apt update && sudo apt upgrade
ddev exec "bin/console contao:migrate"
```


## Projekt erstellen

Öffne die Konsole deiner Wahl, erstelle das gewünschte Verzeichnis und wechsle danach in ebendieses.
Backend-User anlegen:

```shell
mkdir -p ~/Projekte/contao/contao-ddev && cd ~/Projekte/contao/contao-ddev
ddev exec "bin/console contao:user:create"
```

DDEV-Konfiguration anlegen mit:
Projekt im Browser aufrufen:

```shell
ddev config
ddev launch
```

DDEV-Einstellungen vornehmen, als __Project Type__ auf jeden fall `php` auswählen. Die __Docroot Location__ erstmal leer lassen, da es bei Neuinstallationen noch keinen `public` Ordner gibt und DDEV dann nicht starten kann.

```shell
ddev start
```
{{% notice note %}}

Zur Installation via Konsole ist es am einfachsten, sich via SSH mit dem Container zu verbinden.
Mit `ddev launch contao` kommst du direkt zur Administration.

```shell
ddev ssh
```
{{% /notice %}}

```shell
composer create-project contao/managed-edition contao 4.13
```
## Zusatz Informationen

In der `.ddev/config.yaml` nun das Docroot anpassen und ddev neu starten.
`ddev start` startet das Projekt, `ddev stop` beendet es. Stelle vorher sicher, dass du in den Projektordner gewechselt hast.

```yaml
docroot: "contao/public"
```
`ddev poweroff` kann aus jedem Verzeichnis heraus alle gestarteten Projekte/Container stoppen.

Um Apache anstatt NGINX zu verwenden, den Eintrag `webserver_type: nginx-fpm` in `apache-fpm` ändern.
Mit `ddev ssh` wechselst du in die Shell des Containers und kannst auf der Konsole arbeiten. Die `ddev` Binary steht im Container nicht zur Verfügung, also erst mit `exit` auf die Host-Konsole wechseln.

```yaml
webserver_type: apache-fpm
```
`ddev describe` gibt eine Übersicht der Services, die im Projekt zur Verfügung stehen und wie du sie erreichst.

Die `ddev` Binary steht im Container nicht zur Verfügung, also erst mit `exit` auf die Host-Konsole wechseln.
`ddev xdebug on` startet XDebug. [Informationen zum IDE-Setup](https://ddev.readthedocs.io/en/latest/users/debugging-profiling/step-debugging/#ide-setup)

```shell
ddev restart
```
{{% notice note %}}
Falls du als Windows Anwender die »Git Bash« als Konsole benutzt, kann es, abhängig von deiner »Git für Windows« Konfiguration, notwendig sein das Kommando `winpty` voran zu stellen (z. B.: `winpty ddev ssh`).
{{% /notice %}}

Eine Datenbank gibt es schon in DDEV. Die Verbindungsdaten für die Installation lauten:
## Custom PHP Configuration

| Eintrag | Wert |
|:--------------------|:----------------------|
| **Host** | db |
| **Benutzername** | db |
| **Passwort** | db |
| **Datenbank** | db |
Mit DDEV können zusätzliche PHP-Konfigurationen für ein Projekt bereitgestellt werden. Du kannst eine beliebige Anzahl von `.ini` Dateien im Verzeichnis `.ddev/php/` hinzufügen. Änderungen erfordern einen Neustart mit `ddev restart`. Weitere Informationen in der [DDEV-Dokumentation](https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#custom-php-configuration-phpini).

Auf die Datenbank des aktuellen Projektes kann über das phpMyAdmin Add-On zugegriffen werden. Mit folgenden Befehl öffnet sich nach Eingabe automatisch ein Browser-Tab mit dem Administrationswerkzeug für MySQL-Datenbanken:
Eine Beispieldatei in `.ddev/php/my-php.ini` könnte wie folgt aussehen:

```shell
ddev phpmyadmin
```ìni
[PHP]
memory_limit = -1
```
Seit ddev Version 1.22.0 ist die Unterstützung von phpmyadmin in ein DDEV Add-on umgewandelt worden. Daher muss statt `ddev launch -p` der obige Befehl verwendet werden.

{{% notice note %}}
Mit `ddev describe` erhältst du eine Übersicht über Services, die im Projekt zur Verfügung stehen und wie du sie erreichst. Mit `ddev poweroff` kannst du aus jedem Verzeichnis heraus alle gestarteten Projekte/Container stoppen.

{{% /notice %}}


## DDEV Addons

DDEV bietet nun auch [Services als Addon](https://ddev.readthedocs.io/en/latest/users/extend/additional-services/).
DDEV bietet auch [Services als Addon](https://ddev.readthedocs.io/en/latest/users/extend/additional-services/).


### Beispiel: Adminer
Expand All @@ -150,14 +117,4 @@ DDEV bietet nun auch [Services als Addon](https://ddev.readthedocs.io/en/latest/
ddev get ddev/ddev-adminer && ddev restart
```

Zudem kann man phpMyAdmin in der `.ddev/config.yaml` auch deaktivieren:

```yaml
omit_containers: [dba]
```

```shell
ddev restart
```


Mit `ddev describe` erfährst du, wie du Adminer erreichst.
108 changes: 39 additions & 69 deletions docs/manual/guides/local-installation/ddev.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,119 +26,87 @@ more information about installing these programs.

DDEV is available for all platforms, please refer to the [DDEV documentation](https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/) for the installation of your platform.

## Create project

### Example: Perform the installation on macOS with __brew__.

```shell
brew install ddev/ddev/ddev
```

After the installation install the local SSL certificates (afterwards restart your browser).
Open the console of your choice, create the desired directory and then change to it. The directory name reflects the subsequent project hostname. However, you can [configure this](https://ddev.readthedocs.io/en/latest/users/extend/additional-hostnames/) additionally.

```shell
mkcert -install
mkdir -p ~/projects/contao/contao-ddev && cd ~/projects/contao/contao-ddev
```

You should also update your installation regularly.
Create the DDEV configuration with:

```shell
brew upgrade ddev
ddev config --project-type=php --docroot=public --webserver-type=apache-fpm --php-version=8.2 --create-docroot --timezone=Europe/Berlin
```


### Example: Installation on Debian/Ubuntu
Install Contao 5.3:

```shell
curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null

echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list

sudo apt update && sudo apt install -y ddev
ddev composer create contao/managed-edition:5.3
```

If necessary, install the local SSL certificates after the installation (afterwards restart your browser).
After installation, the database access data must be entered in the `.env.local`. At the same time, we also set up Mailpit directly.

```shell
mkcert -install
```env
APP_ENV=prod
DATABASE_URL=mysql://db:db@db:3306/db
MAILER_DSN=smtp://localhost:1025
```

Installation Update
Then create the database:

```shell
sudo apt update && sudo apt upgrade
ddev exec "bin/console contao:migrate"
```


## Create project

Open the console of your choice, create the desired directory and then change to it.
Create backend user:

```shell
mkdir -p ~/projects/contao/contao-ddev && cd ~/projects/contao/contao-ddev
ddev exec "bin/console contao:user:create"
```

Create the DDEV configuration with:
Call up the project in the browser:

```shell
ddev config
ddev launch
```

Make DDEV settings, select `php` as __Project Type__ in any case. Leave the __Docroot Location__ empty for now, because there is no `public` folder for new installations and DDEV can not start then.
{{% notice note %}}

```shell
ddev start
```
With `ddev launch contao` you get directly to the administration.

For installation via console it is easiest to go via ssh into the container.
{{% /notice %}}

```shell
ddev ssh
```
The `ddev` binary is not available in the container, so first switch to the host console with `exit`.

```shell
composer create-project contao/managed-edition contao 4.13
```
## Additional information

In the `.ddev/config.yaml` now adjust the docroot and restart ddev.
`ddev start` starts the project, `ddev stop` ends it. Make sure beforehand that you have changed to the project folder.

```yaml
docroot: "contao/public"
```
`ddev poweroff` can stop all started projects/containers from any directory.

To use Apache instead of NGINX, change your entry `webserver_type: nginx-fpm` to `apache-fpm`.
With `ddev ssh` you can switch to the shell of the container and work on the console. The `ddev` binary is not available in the container, so first switch to the host console with `exit`.

```yaml
webserver_type: apache-fpm
```
`ddev describe` gives an overview of the services available in the project and how to access them.

The `ddev` binary is not available in the container, so first switch to the host console with `exit`.
`ddev xdebug on` starts XDebug. [Information about the IDE setup](https://ddev.readthedocs.io/en/latest/users/debugging-profiling/step-debugging/#ide-setup)

```shell
ddev restart
```
{{% notice note %}}
If you are a Windows user using the "Git Bash" as a console, it may be necessary, depending on your "Git for Windows" configuration, to prepend the command `winpty` (e.g.: `winpty ddev ssh`).
{{% /notice %}}

A database already exists in DDEV. The connection data for the installation are:
## Custom PHP Configuration

| entry | value |
|:--------------------|:----------------------|
| **host** | db |
| **username** | db |
| **password** | db |
| **Database** | db |
DDEV can be used to provide additional PHP configurations for a project. You can add any number of `.ini` files in the directory `.ddev/php/`. Subsequent changes require a `ddev restart`. Further information can be found in the [DDEV documentation](https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#custom-php-configuration-phpini).

The database of the current project can be accessed via the phpMyAdmin add-on. Enter the following command to automatically open a browser tab with the administration tool for MySQL databases:
An example file in `.ddev/php/my-php.ini` could look like this:

```shell
ddev phpmyadmin
```ìni
[PHP]
memory_limit = -1
```

Since ddev version 1.22.0 the support of phpmyadmin has been converted into a DDEV add-on. Therefore the above command must be used instead of `ddev launch -p`.

{{% notice note %}}
With `ddev describe` you get an overview of the services available in the project and how to reach them. With `ddev poweroff` you can stop all started projects/containers from any directory.

{{% /notice %}}


## DDEV Addons

Expand All @@ -150,3 +118,5 @@ DDEV now offers [Services as Addon](https://ddev.readthedocs.io/en/latest/users/
```shell
ddev get ddev/ddev-adminer && ddev restart
```

With `ddev describe` you can find out how to reach Adminer.