You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,7 @@ docker ps
101
101
| 09f51b5f330b | dockerize-existing-drupal-project_apache | "httpd-foreground" | 32 seconds ago | Up 30 seconds | 0.0.0.0:80->80/tcp | apache |
102
102
| 8294e1800058 | dockerize-existing-drupal-project_php | "docker-php-entrypoi…" | 33 seconds ago | Up 31 seconds | 9000/tcp | php |
103
103
| d8b2cbac5695 | mysql:8.0.0 | "docker-entrypoint.s…" | 33 seconds ago | Up 31 seconds | 0.0.0.0:3306->3306/tcp | mysql |
104
+
104
105
5. Now jump into the PHP container using the `docker exec` command.
105
106
```
106
107
docker exec -it 8294e1800058 /bin/sh
@@ -109,13 +110,15 @@ Since you will be using the `root` user inside the container, so you should have
109
110
```
110
111
/var/www/html # ls
111
112
```
112
-
If it shows you `index.php` that means it mounts to your local repository i.e. `docroot`
113
+
If it shows you `index.php` that means it mounts to your local repository i.e. `docroot`.
114
+
113
115
6. Now hit the http://localhost:80 in browser to ensure setup is successful. Along with the below output, you will also see phpinfo() output.
114
116
```
115
117
Congratulations!! Docker setup connection is successful.
116
118
Checking MySQL integration with php.
117
119
MySql connection is successful!
118
120
```
121
+
119
122
7. Now the docker setup is done, you can put your local codebase inside the `docroot`. Now it's up to you whether you want to run multiple drupal instances within this repository or a single one. If you want to manage multiple repositories then keep the project folder inside the `docroot` repository. For example, in our case, it's `drupal8` repository.
120
123
121
124
```
@@ -150,14 +153,14 @@ Now this project Drupal's docroot should be located at `/var/www/html/drupal8/we
150
153
drush sql:dump --result-file=../backup.sql
151
154
```
152
155
Here `backup.sql` is your mysql database backup file. It can different in your case.
156
+
153
157
9. Now access your drupal project in browser. For example, in our case it would be below URL:
154
158
```
155
159
http://localhost/drupal8/web
156
160
```
157
-
We may create virtual host entry for above URL.
158
-
10.
161
+
We may create virtual host entry for above URL. With some browsers and operating systems any path ending in `localhost` will work automatically, otherwise you may need update your hosts file so your browser will know it's a local url.
159
162
160
-
--WIP---
163
+
10. Also to exit from a container, just type `exit` in terminal.
0 commit comments