Provides a Traefik proxy that is independent of docker4drupal. This allows a web developer to have several projects running at the same time.
- Clone this repository locally to your machine.
- Navigate into the cloned respository and run
make start
- To stop run
make stop
- To see the Traefik logs run
make view-logs
When Traefik is running you can access its dashboard at https://monitor.localhost
Remove
COMPOSE_PROJECT_NAME
Add the following:
PROJECT_NAME=mylovelproject
PROJECT_BASE_URL=mylovelproject.localhost
Replace mylovelproject
with your project
In the docker-compose.yml
file you must add container_name
parameters to each of you active services.
Use the pattern
container_name: "${PROJECT_NAME}_mylovelyservice"
Replace mylovelyservice
with the name of the service you are adding the parameter to.
So, the value of the container_name
parameter of the mariadb
service would be:
container_name: "${PROJECT_NAME}_mariadb"
To each service add the following:
networks:
- proxy
Remove the traefik.backend
labels from all services.
Remove or comment out the service definition for traefik
.
Add the following to the bottom of the file:
networks:
proxy:
external: true
Add the following parameter to the php
service:
D4D_HOSTNAME: ${PROJECT_BASE_URL}
Add the following mapping to the $base_domains
array:
getenv('D4D_HOSTNAME') => 'local'
Alter the uri
key of the docker
alias:
'uri' => getenv('D4D_HOSTNAME')