-
Run docker-compose containers. Containers will be initialised (updated), started and run in detached mode. Use it always to run the containers.
$ docker-compose up -d
-
Stop docker-compose containers.
NOTE! Use it when you go home to continue tomorrow!
$ docker-compose stop
Or stop particular container
$ docker-compose stop nginx
-
Stop and destroy containers.
CAUTION! All data in containers will be lost. If the DB is in docker volume, it will be lost. Use it only when you are done or want to fully re-initilisee containers. In most cases
upis enough.$ docker-compose down
-
Restart whole project or a particular container, e.g.
nginxis restarted only in that way.$ docker-compose restart $ docker-compose restart nginx
These will not update containers when
docker-compose.ymlis changed, useup. -
See container logs. Use to check service specific logs, e.g. when nginx container doesn't start
$ docker-compose logs nginx
-
Run a command in a container
$ docker-compose exec eneus_php bash $ docker-compose exec --user=root eneus_php bash $ docker-compose exec eneus_php drush cc all
-
Go inside container with
$ docker-compose exec eneus_php shand use
drush,drupal,composeras on local machine. -
Clear cache from host machine
$ docker-compose exec eneus_php drush cc all -
Clear varnish with qtools
$ docker-compose exec eneus_php sh $ drush eval 'return qtools_varnish_purge_request( "/" );'
-
Restart varnish to clear cache
$ docker-compose restart varnish
-
SQL dump
Put sql dump file into project directory or map it in
docker-compose.override.ymltoeneus_phpservice.Run container cli and run
drushfromdocroot$ docker-compose exec eneus_php bash $ gunzip < dump.sql.gz | drush sql-cli
To access the website add records to /etc/hosts:
127.0.0.1 mufe.local central.mufe.local html.mufe.local
Change settings.php to use internal docker DNS names. Internal DNS names are the same as container name in docker-compose.yml.
-
For database
hostwill bemariadb:$databases = array ( 'default' => array ( 'default' => array ( 'database' => 'eneus', 'username' => 'eneus', 'password' => 'eneus', 'host' => 'mysql', 'port' => '3306', 'driver' => 'mysql', 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql', 'prefix' => '', ), ), );
-
Memcache:
$conf['memcache_servers'] = array( 'memcached:11211' => 'default', 'memcached2:11211' => 'bin2', 'memcached3:11211' => 'bin3', 'memcached4:11211' => 'bin4', 'memcached5:11211' => 'bin5', 'memcached6:11211' => 'bin6', );
-
Varnish:
$conf['qtools_varnish_settings']['connection']['control_terminal'] = 'varnish:6082'; $conf['qtools_varnish_settings']['connection']['control_key'] = 'local';
Local configuration may require to override configuration which is in git.
Use docker-compose.override.yml which is gitignored. There is a proposed local configuration in docker-compose.override.yml.dist file.
$ cp docker-compose.override.yml.dist docker-compose.override.ymlRead comments in the file to tune for your needs.
-
Configure host IP address to be known in docker environment.
MacOS:
$ sudo ifconfig lo0 alias 10.254.254.254IP can be set on startup, refer to https://wodby.com/stacks/drupal/docs/local/xdebug/
Linux and Windows must have IPs already configured. Linux -
172.17.0.1and Windows10.0.75.1(default). -
Configure PhpStorm, open Settings
-
On Languages & Frameworks -> Debug
Set Max. simultaneous connections to more than
1(e.g.5) to correctly accept drush connections from CLI -
On Languages & Frameworks -> Debug -> DBGp Proxy set
-
IDE Key:
PHPSTORM -
Host:
10.254.254.254(Mac only)Host might not be required on Linux and Windows. Check Automatically detect IDE IP on Languages & Frameworks -> Debug for Linux -
172.17.0.1and Windows10.0.75.1(default).
- On Languages & Frameworks -> Servers add new server with
+
-
Name:
application(name is set to handle CLI debug, in docker-compose the same name is defined as env variable), -
Host:
mufe.local(website uri),Map project files to docker (change localpath to yours):
-
Project files:
/your/local/path/to/MUFE -
Absolute path on the server:
/var/www/MUFE