Logs
You can access all the containers logs, using these commands:
$ drucker logs
You can also check all Drupal logs, inside the admin page /admin/reports/dblog
, or using:
$ drucker dblog
Multiple projects
You can launch and manage many Drucker instances at the same time. This is usefull when you work on multiple website in parrallel.
For example, if you have 2 projects in 2 differents folders, you can open 2 separated bash, and source the env of each project separately.
To make it works, you need to set differents values inside the drucker.config
of your projects:
PROJECT_NAME
andPROJECT_NAME_PLAIN
must have different values for each projectsPUBLIC_WWW_PORT
andPUBLIC_PMA_PORT
must have different ports for each projectsSUBNET
must have different values for each projects: just change the 3rd octet of IP-addresses
Example:
- project1:
PROJECT_NAME=Project1
andPROJECT_NAME_PLAIN=project1
PUBLIC_WWW_PORT=19580
andPUBLIC_PMA_PORT=19581
SUBNET=172.16.1
- You can open a separated bash and run
cd <project1>; cd drucker; source load-env; drucker start
. - -> your website will be accessible with the URL:
http://localhost:19580
(andhttp://localhost:19581
)
- project2:
PROJECT_NAME=Project2
andPROJECT_NAME_PLAIN=project2
PUBLIC_WWW_PORT=19590
andPUBLIC_PMA_PORT=19591
SUBNET=172.16.2
- You can open a separated bash and run
cd <project2>; cd drucker; source load-env; drucker start
. - -> your website will be accessible with the URL:
http://localhost:19590
(andhttp://localhost:19591
)
Backup - Full
You can create a snapshot of all your Drupal at anytime (files and database), using this command:
$ drush archive-dump
This command will create a tar.gz
file, that will be stored inside drucker/docker-runtime/drush-backups
.
To restore the full backup, you can use this command:
$ drush archive-restore --overwrite /home/www-data/drush-backups/archive-dump/path/to/backup
Replace the path/to/backup
by the path of the archive contained inside drucker/docker-runtime/drush-backups
.
!!! danger “” This command will overwrite all your current files and database!
Backup - SQL Database only
You can create a backup of the SQL database only (so, without files), using these commands:
$ drucker sql-backup
# prompt: enter the name of the backup
The backup will be stored inside drucker/docker-runtime/sql-backups
.
You can then restore a backup using these commands:
$ drucker sql-restore
# prompt: enter the name of the backup to restore
!!! note “”
- You can type l
to list all the available backups.
- When the backup is restored, you’ll be invited to sanitize the database (recommanded).
SQL Sanitize
You can sanitize the current database, using these commands:
$ drucker sql-sanitize
This will reset all password accounts and emails.
Accessing containers
You can access PHP containers, using the shortcuts:
php
: to run a shell inside the PHP container, as current userphproot
: to run a shell inside the PHP container, as root user (use it with caution!)
Modules patches
You can apply patches, using Composer: read this.