A simple set of files to help develop a Drupal site locally in Docker containers.
Uses Docker, Docker Compose and Traefik.
We use Traefik to provide nice local URLS for development like mysite.localhost, but this isn't necessary. If you have trouble with it, you can remove it and run the site using just localhost:{port} as usual for Docker containers.
-
Install Docker Compose if you didn't get it with Docker
-
Create a network for Traefik:
docker network create traefik
-
Start the Traefik container:
cd traefik; docker compose up -d
-
Run these containers:
cd ..; docker compose up -d
To execute code inside a container:
docker exec -ti CONTAINERID bash
Use the MariaDB container (db) if you want to run MySQL commands, and the PHP container (php) for everything else.
You can customise the resources the PHP container will use using the drupal.ini file. Make sure to recreate the containers if you do.
This project was created by Dane Rossenrode at Touchdreams.