Skip to content
Snippets Groups Projects
Commit 75eea4c9 authored by danielspeicher's avatar danielspeicher
Browse files
parent 6f9d5d20
No related branches found
No related tags found
1 merge request!19composer/library/docker-traefik#7
......@@ -7,6 +7,15 @@ tags:
---
# Docker Traefik
to be done.
[Traefik](https://traefik.io/) is one of our most important tool. We provide this library here
to set up all network related communication in our environments.
[Traefik dashboard](http://traefik.docker.localhost:8000/dashboard/)
A `Traefik` network is always running, if not see [here](../../../docker/l3d/index.md#traefik-network).
You can define [L3D](../../../docker/l3d/index.md) projects running in
parallel [managed by Traefik](../../../docker/l3d/drupal.md#working-with-multiple-projects-in-parallel).
See the dashboard: `http(s)://traefik.<your-root.domain>/dashboard`. Here you have a great overview of all
routers, services and middlewares:
![Traefik Dasboard](/files/screenshots/traefik_dashboard_screenshot.png)
......@@ -7,6 +7,20 @@ tags:
# Debugging Drupal Code
Debugging PHP can be a game changer in Drupal development. In the context of L3D
in combination with the composer plugin [Docker4Drupal](/composer/plugin/d4d)
this is provided out of the box and configured very easily. We describe the
steps for PhpStorm, but other IDEs should be very similar.
As XDebug comes with a performance hit, it is turned off by default. When you
need it, simply call `ahoy debug on` in you L3D container of the project you
want to debug and the scripts will reconfigure the PHP container and refresh
it with a few seconds. When you've finished debugging, you may want to turn it
off again with `ahoy debug off`.
XDebug version 3 connects to port 9003 of your IDE and PhpStorm is preconfigured
by default to list on that port.
## Add a PHP Server
First, you have to set up a Drupal environment with the tool [l3d](../docker/l3d/index.md). The tool is
......
......@@ -32,28 +32,31 @@ DOCKER_IMAGE_PREFIX=
DORGFLOW=0
DRUPAL_LIVE=0
GITLAB_PRIVATE_TOKEN=
GITLAB_URL=
GITLAB_URL=https://gitlab.lakedrops.com
LOCAL_IP=1
MAILHOG_HOST=smtp.freesmtpservers.com
MAILHOG_MECHANISM=NONE
MAILHOG_HOST=smtprelaypool.ispgateway.de
MAILHOG_MECHANISM=PLAIN
MAILHOG_PASSWORD=
MAILHOG_PORT=25
MAILHOG_USERNAME=
MAILPIT_HOST=smtp.freesmtpservers.com
MAILPIT_PORT=25
MAILPIT_USERNAME=
MAILHOG_USERNAME=support@lakedrops.com
MAILPIT_HOST=smtprelaypool.ispgateway.de
MAILPIT_PORT=587
MAILPIT_USERNAME=support@lakedrops.com
MAILPIT_PASSWORD=
MAILPIT_STARTTLS=
MAILPIT_ALLOW_INSECURE=
MAILPIT_AUTH=none
MAILPIT_STARTTLS=true
MAILPIT_ALLOW_INSECURE=true
MAILPIT_AUTH=plain
MAILPIT_SECRET=
MAILPIT_RETURNPATH=
MAILPIT_RECIPIENT_ALLOW_LIST=
NODE_VERSION=18-slim
PHP_COVERAGE=0
PHP_DEBUG=0
PHP_PROFILER=0
PHP_VERSION=8.1
UNLIGHTHOUSE=0
WEBSERVER_CONFIG_OVERWRITE=0
UNLIGHTHOUSE=0
RENDERER_CONFIG_DEBUG=0
```
### ~/.gitconfig
......
......@@ -216,36 +216,6 @@ DOCKER4DRUPAL_TRAEFIK_KEY=privkey.pem
Note: every 2 months you will have to renew the SSL cert with LetsEncrypt by calling `certbot renew` and then copying the new cert files into the same directory ad described above and then restart Traefik.
## Using XDebug
Debugging PHP can be a game changer in Drupal development. In the context of L3D
in combination with the composer plugin [Docker4Drupal](/composer/plugin/d4d)
this is provided out of the box and configured very easily. We describe the
steps for PhpStorm, but other IDEs should be very similar.
As XDebug comes with a performance hit, it is turned off by default. When you
need it, simply call `ahoy debug on` in you L3D container of the project you
want to debug and the scripts will reconfigure the PHP container and refresh
it with a few seconds. When you've finished debugging, you may want to turn it
off again with `ahoy debug off`.
XDebug version 3 connects to port 9003 of your IDE and PhpStorm is preconfigured
by default to list on that port.
You can then just enable debugging in PhpStorm and wait for the first request
which will prompt you to configure the details. Or you configure actively the
debug configuration:
![Screenshot](/files/screenshots/Screenshot from 2021-01-25 18-59-52.png)
The name and the server name should both be called `Docker`. And the mapping
needs to be configured from your project root directory on your host to the
path `/var/www/html` in the container.
With this setup, you can debug both web requests coming from the browser and
CLI commands for PHP which is executed inside the PHP container like e.g.
drush - all with the same setup.
## Using MailPit
When using the [Docker4Drupal](../../composer/plugin/d4d/index.md), a MailPit service will be configured automatically by default.
......
docs/files/screenshots/traefik_dashboard_screenshot.png

131 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment