Welcome to the Drupal Boilerplate repository. This guide will walk you through setting up a local Drupal development environment using Docker and Visual Studio Code (VS Code).
This boilerplate provides a fully configured environment for professional Drupal development, including:
- Drupal Docker Official Image: Flavoured with development tools for a seamless experience.
- MySQL Database setup with Adminer: A lightweight database management tool.
- PHP XDebug: A powerful debugging tool for PHP.
Ensure Docker and VS Code are installed on your system. Additionally, the Dev Containers extension for VS Code should be installed. Learn more about developing inside containers at VS Code Dev Containers Documentation.
- Clone this repository to your local machine.
- Navigate to the directory with the downloaded repository.
- Run the following command inside the directory to obtain fresh Drupal core code:
docker run --rm --interactive --tty --volume $PWD:/app \
composer create-project --ignore-platform-reqs \
drupal/recommended-project drupal
In order to obtain specific Drupal version try the next command:
docker run --rm --interactive --tty --volume $PWD:/app \
composer create-project --ignore-platform-reqs \
drupal/recommended-project:10.3.5 drupal
-
Open the project with Remote Containers (use the Dev Containers: Reopen in Container command from the Command Palette). The system will automatically download all the dependencies and run the Drush installation script with the standard profile. This process may take a few minutes.
-
After the installation, you can access your Drupal site at
http://localhost:8040
.
Admin user login: drupal
Admin user password: drupal
You can check installation options in the .devcontainer/post-start--install.bash file.
If you'd like to install your site using an existing configuration, please use the .devcontainer/post-start--install-config.bash script. You can configure this in .devcontainer/devcontainer.json by modifying the postStartCommand
.
To install the site from configuration:
- Update the
postStartCommand
indevcontainer.json
. - Ensure you have an existing directory containing the configuration files.
- Confirm that you have a working
settings.php
file (refer toexample.settings.php
if needed). - Ensure your
settings.php
file contains a valid path to theconfig_sync_directory
. - Rebuild the container.
The Adminer interface for database management can be accessed at http://localhost:8080
with the following credentials:
- server:
db
- username:
drupal
- password:
drupal
- database:
drupal