Skip to content

Commit 3baf49a

Browse files
committed
Updated instructions and re-structurized navigation
1 parent 144b8b5 commit 3baf49a

File tree

1 file changed

+54
-47
lines changed

1 file changed

+54
-47
lines changed

README.md

+54-47
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ Use this Docker compose file to spin up local environment for Drupal with a *nat
44

55
* [Overview](#overview)
66
* [Instructions](#instructions)
7-
* [Drush](#drush)
8-
* [Composer](#composer)
9-
* [Drupal Console](#drupal-console)
10-
* [Xdebug](#xdebug)
11-
* [Database](#database)
12-
* [Cache](#cache)
13-
* [Mailhog](#mailhog)
14-
* [phpMyAdmin](#phpmyadmin)
15-
* [Apache Solr](#apache-solr)
16-
* [Accessing containers](#accessing-containers)
7+
* [Containers](#containers)
8+
* [Accessing containers](#accessing-containers)
9+
* [PHP](#php)
10+
* [Drush](#drush)
11+
* [Composer](#composer)
12+
* [Drupal Console](#drupal-console)
13+
* [Xdebug](#xdebug)
14+
* [MariaDB](#mariadb)
15+
* [Import](#import)
16+
* [Export](#export)
17+
* [Redis](#redis)
18+
* [Memcached](#memcached)
19+
* [Mailhog](#mailhog)
20+
* [phpMyAdmin](#phpmyadmin)
21+
* [Apache Solr](#apache-solr)
1722
* [Logs](#logs)
18-
* [Updating](#updating)
1923
* [Status](#status)
20-
* [Troubleshooting](#troubleshooting)
2124
* [Going beyond local machine](#going-beyond-local-machine)
2225

2326
## Overview
@@ -66,61 +69,78 @@ $ sudo chmod -R 775 sites/default/files
6669
DRUPAL_VERSION: 8
6770
```
6871
69-
Choose PHP version by modifying the name of the image:
72+
5\. Choose PHP version by modifying the name of the image:
7073
```yml
7174
image: wodby/drupal-php:7.0 # Allowed: 7.0, 5.6
7275
```
7376
74-
5\. Update database credentials in your settings.php file:
77+
6\. Update database credentials in your settings.php file:
7578
```
7679
database: drupal
7780
username: drupal
7881
password: drupal
7982
host: mariadb
8083
```
8184
82-
6\. If you want to import your database, uncomment the following line in the compose file:
85+
7\. If you want to import your database, uncomment the following line in the compose file:
8386
```yml
8487
# - ./docker-runtime/mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) her
8588
```
8689

8790
Create the volume directory `./docker-runtime/mariadb-init` in the same directory as the compose file and put there your SQL file(s). All SQL files will be automatically imported once MariaDB container has started.
8891

89-
7\. Now, let's run the compose file. It will download the images and run the containers:
92+
8\. If you need to deploy one of the optional containers ([Redis](#redis), [Memcached](#memcached), [Apache Solr](#apache-solr)) uncomment the corresponding lines in the compose file.
93+
94+
9\. Now, let's run the compose file. It will download the images and run the containers:
9095
```bash
9196
$ docker-compose up -d
9297
```
9398

94-
8\. Make sure all containers are running by executing:
99+
10\. Make sure all containers are running by executing:
95100

96101
```bash
97102
$ docker-compose ps
98103
```
99104

100-
9\. That's it! You drupal website should be up and running at http://localhost:8000.
105+
11\. That's it! You drupal website should be up and running at http://localhost:8000.
106+
107+
## Containers
108+
109+
### Accessing containers
110+
111+
You can connect to any container by executing the following command:
112+
```bash
113+
$ docker-compose exec php sh
114+
```
115+
116+
Replace `php` with the name of your service (e.g. `mariadb`, `nginx`, etc).
117+
118+
### PHP
119+
120+
Currently PHP version 5.6 and 7 are provided. Check out [the instructions (step 5)](#instructions) to learn how to switch the version.
101121

102-
## Drush
122+
#### Drush
103123

104124
PHP container has installed drush. When running drush make sure to open the shell as user 82 (www-data) to avoid access problems in the web server, which is running as user 82, too:
105125
```bash
106126
$ docker-compose exec --user 82 php drush
107127
```
108128

109-
## Composer
129+
#### Composer
110130

111131
PHP container has installed composer. Example:
112132
```bash
113133
$ docker-compose exec --user 82 php composer update
114134
```
115135

116-
## Drupal Console
136+
#### Drupal Console
117137

118138
PHP container has installed drupal console. Example:
119139
```bash
120140
$ docker-compose exec --user 82 php drupal list
121141
```
122142

123-
## Xdebug
143+
#### Xdebug
124144

125145
If you want to use xdebug, uncomment the following line in the compose file:
126146

@@ -130,9 +150,13 @@ If you want to use xdebug, uncomment the following line in the compose file:
130150

131151
See the <a href="https://github.com/Wodby/drupal-php/issues/1" target="_blank">known issue</a> with Xdebug in Mac OS.
132152

133-
## Database
153+
### MariaDB
134154

135-
### Export
155+
#### Import
156+
157+
Check out [the instructions (step 7)](#instructions) to learn how to import your existing database.
158+
159+
#### Export
136160

137161
Exporting all databases:
138162

@@ -146,8 +170,6 @@ Exporting a specific database:
146170
docker-compose exec mariadb sh -c 'exec mysqldump -uroot -p"root-password" my-db' > my-db.sql
147171
```
148172

149-
## Cache
150-
151173
### Redis
152174

153175
To spin up a container with Redis cache and use it as a default cache storage follow these steps:
@@ -183,27 +205,18 @@ $conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
183205
$conf['memcache_servers'] = array('memcached:11211' => 'default');
184206
```
185207

186-
## Mailhog
208+
### Mailhog
187209

188210
By default, container with mailhog included in the bundle. It will catch all email sent from the PHP container. You can view emails by visiting its admin UI on localhost:8002.
189211

190-
## phpMyAdmin
212+
### phpMyAdmin
191213

192214
By default, container with phpMyAdmin included in the bundle. You can accessit by localhost:8001
193215

194-
## Apache Solr
216+
### Apache Solr
195217

196218
To spin up a container with Apache Solr search engine uncomment lines with solr service definition in the compose file. Use volume directory `./docker-runtime/solr` to access configuration files. Solr admin UI can be accessed by localhost:8003
197219

198-
## Accessing containers
199-
200-
You can connect to any container by executing the following command:
201-
```bash
202-
$ docker-compose exec php sh
203-
```
204-
205-
Replace `php` with the name of your service (e.g. `mariadb`, `nginx`).
206-
207220
## Logs
208221

209222
To get logs from a container simply run (skip the last param to get logs form all the containers):
@@ -216,21 +229,15 @@ Example: real-time logs of the PHP container:
216229
$ docker-compose logs -f php
217230
```
218231

219-
## Updating
232+
## Status
233+
234+
We're actively working on this instructions and containers. More options will be added soon. If you have a feature request or found a bug please submit an issue.
220235

221236
We update containers from time to time, to get the lastest changes simply run again:
222237
```
223238
$ docker-compose up -d
224239
```
225240

226-
## Status
227-
228-
We're actively working on this instructions and containers. More options will be added soon. If you have a feature request or found a bug please sumbit an issue.
229-
230-
## Troubleshooting
231-
232-
In case you have any problems submit an issue or contact us at hello [at] wodby.com.
233-
234241
## Going beyond local machine
235242

236243
Check out <a href="https://wodby.com" target="_blank">Wodby</a> if you need optimized consistent docker-based environment for Drupal on your dev/staging or production servers.

0 commit comments

Comments
 (0)