Skip to content

Commit b0222ec

Browse files
author
Dima
authored
Merge pull request #5 from drupal-ukraine/update-d4d
Update drupal8docker
2 parents d720007 + fadd520 commit b0222ec

11 files changed

Lines changed: 2532 additions & 3674 deletions

File tree

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Ignore directories generated by Composer
2+
/drush/contrib/
3+
/vendor/
4+
/web/
5+
/drush/
6+
/docker-runtime/
7+
/scripts/
8+
/docroot/
9+
/web/modules/contrib/
10+
/web/themes/contrib/
11+
/web/profiles/contrib/
12+
/web/libraries/
13+
14+
# Ignore sensitive information
15+
/web/sites/*/settings.php
16+
/web/sites/*/settings.local.php
17+
18+
# Ignore Drupal's file directory
19+
/web/sites/*/files/
20+
21+
# Ignore SimpleTest multi-site environment.
22+
/web/sites/simpletest
23+
24+
# Ignore files generated by PhpStorm
25+
/.idea/
26+
/composer.json
27+
/.travis.yml
28+
/composer.lock
29+
/LICENSE
30+
/phpunit.xml.dist
31+
/.docker-sync/
32+
!/docroot/modules/panels/
33+
!/docroot/modules/page_manager/

README.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,41 @@
44

55
2. Install docker (https://docs.docker.com/engine/installation/) and docker compose (https://docs.docker.com/compose/install/)
66

7-
3. Run in console "docker-compose up -d --build && sh run.sh".
7+
3. Run in console "docker-compose up -d".
88

9-
Site will available on host: http://localhost:8999
9+
4. chmod +x run.sh
10+
11+
## Links:
12+
Site will available on host: http://panels_d8.docker.localhost:8877 or http://localhost:2877
1013

11-
Phpmyadmin available on host: http://localhost:8001
14+
Phpmyadmin available on host: http://pma.panels_d8.docker.localhost:8877 or http://localhost:2878
1215

13-
Access to admin side - admin:admin
16+
Access to admin side - `admin`:`admin`
1417

15-
More info about docker images - https://github.com/wodby/docker4drupal
18+
## Container access examples:
19+
`$ docker-compose exec php drush cr`
20+
`$ docker-compose exec php bash`
21+
`$ docker-compose exec php drush en ctools -y`
22+
23+
## Mac Users
24+
To fix Docker poor performance on macOS use the following workaround based on docker-sync project. The core idea is to replace a standard slow volume with a file synchronizer tool.
25+
26+
1. Install the tool
27+
`$ gem install docker-sync`
28+
29+
2. Start sync container (may take up to ):
30+
`$ docker-sync start`. Use `docker-sync stop` to stop sync.
31+
`$ docker-sync clean` cleanup before next run.
32+
33+
Following lines indicates the container is started:
34+
35+
```
36+
ok Starting native_osx for sync codebase
37+
success Sync container started
38+
success Starting Docker-Sync in the background
39+
```
40+
41+
## Then do a composer start with specific compose file
42+
`$ docker-compose -f docker-compose-mac.yml up -d`
43+
44+
More info about docker-compose environment images - https://github.com/wodby/docker4drupal

docker-compose-mac.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
version: "2"
2+
3+
services:
4+
mariadb:
5+
image: wodby/mariadb:10.1-2.1.0
6+
environment:
7+
MYSQL_ROOT_PASSWORD: password
8+
MYSQL_DATABASE: drupal
9+
MYSQL_USER: drupal
10+
MYSQL_PASSWORD: drupal
11+
volumes:
12+
- ./sqldump:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
13+
- ./docker-runtime/mariadb:/var/lib/mysql # I want to manage volumes manually.
14+
15+
php:
16+
# 1. Images with vanilla Drupal – wodby/drupal:[DRUPAL_VERSION]-[PHP_VERSION]-[STABILITY_TAG].
17+
# image: wodby/drupal:8-7.1-2.1.2
18+
# image: wodby/drupal:8-7.0-2.1.2
19+
# image: wodby/drupal:7-7.1-2.1.2
20+
# image: wodby/drupal:7-7.0-2.1.2
21+
# image: wodby/drupal:7-5.6-2.1.2
22+
# image: wodby/drupal:6-5.6-2.1.2
23+
# image: wodby/drupal:6-5.3-2.1.2
24+
# 2. Images without Drupal – wodby/drupal-php:[PHP_VERSION]-[STABILITY_TAG].
25+
# image: wodby/drupal-php:7.1-2.1.0
26+
image: wodby/drupal-php:7.0-2.1.0
27+
# image: wodby/drupal-php:5.6-2.1.0
28+
# image: wodby/drupal-php:5.3-2.1.0
29+
environment:
30+
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
31+
DB_HOST: mariadb
32+
DB_USER: drupal
33+
DB_PASSWORD: drupal
34+
DB_NAME: drupal
35+
DB_DRIVER: mysql
36+
PHP_XDEBUG: 1
37+
PHP_XDEBUG_DEFAULT_ENABLE: 1
38+
PHP_XDEBUG_REMOTE_CONNECT_BACK: 0 # This is needed to respect remote.host setting bellow
39+
PHP_XDEBUG_REMOTE_HOST: "10.254.254.254" # You will also need to 'sudo ifconfig lo0 alias 10.254.254.254'
40+
volumes:
41+
# - ./docroot/:/var/www/html
42+
- codebase:/var/www/html
43+
44+
nginx:
45+
# wodby/drupal-nginx:[DRUPAL_VERSION]-[NGINX_VERSION]-[STABILITY_TAG].
46+
image: wodby/drupal-nginx:8-1.10-2.1.0
47+
# image: wodby/drupal-nginx:7-1.10-2.1.0
48+
# image: wodby/drupal-nginx:6-1.10-2.1.0
49+
depends_on:
50+
- php
51+
environment:
52+
NGINX_SERVER_NAME: panels_d8
53+
NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"
54+
NGINX_ERROR_LOG_LEVEL: debug
55+
NGINX_BACKEND_HOST: php
56+
NGINX_SERVER_ROOT: /var/www/html
57+
volumes:
58+
# - ./docroot/:/var/www/html
59+
- codebase:/var/www/html
60+
labels:
61+
- 'traefik.backend=nginx'
62+
- 'traefik.port=80'
63+
- 'traefik.frontend.rule=Host:panels_d8.docker.localhost'
64+
ports:
65+
- '2877:80'
66+
67+
# varnish:
68+
# image: wodby/drupal-varnish:4.1-2.1.0
69+
# depends_on:
70+
# - nginx
71+
# environment:
72+
# VARNISH_SECRET: secret
73+
# VARNISH_BACKEND_HOST: nginx
74+
# VARNISH_BACKEND_PORT: 80
75+
# labels:
76+
# - 'traefik.backend=varnish'
77+
# - 'traefik.port=6081'
78+
# - 'traefik.frontend.rule=Host:varnish.panels_d8.docker.localhost'
79+
80+
# redis:
81+
# image: wodby/redis:3.2-2.1.0
82+
83+
pma:
84+
image: phpmyadmin/phpmyadmin
85+
environment:
86+
PMA_HOST: mariadb
87+
PMA_USER: drupal
88+
PMA_PASSWORD: drupal
89+
PHP_UPLOAD_MAX_FILESIZE: 1G
90+
PHP_MAX_INPUT_VARS: 1G
91+
labels:
92+
- 'traefik.backend=pma'
93+
- 'traefik.port=80'
94+
- 'traefik.frontend.rule=Host:pma.panels_d8.docker.localhost'
95+
ports:
96+
- '2878:80'
97+
98+
# solr:
99+
## wodby/drupal-solr:[DRUPAL_VERSION]-[SOLR_VERSION]-[STABILITY_TAG].
100+
# image: wodby/drupal-solr:8-6.4-2.0.0
101+
## image: wodby/drupal-solr:8-6.3-2.0.0
102+
## image: wodby/drupal-solr:8-5.5-2.0.0
103+
## image: wodby/drupal-solr:7-6.4-2.0.0
104+
## image: wodby/drupal-solr:7-6.3-2.0.0
105+
## image: wodby/drupal-solr:7-5.5-2.0.0
106+
# environment:
107+
# SOLR_HEAP: 1024m
108+
# labels:
109+
# - 'traefik.backend=solr'
110+
# - 'traefik.port=8983'
111+
# - 'traefik.frontend.rule=Host:solr.panels_d8.docker.localhost'
112+
113+
# mailhog:
114+
# image: mailhog/mailhog
115+
# labels:
116+
# - 'traefik.backend=mailhog'
117+
# - 'traefik.port=8025'
118+
# - 'traefik.frontend.rule=Host:mailhog.panels_d8.docker.localhost'
119+
120+
# node:
121+
# image: node:7-alpine
122+
# working_dir: /app
123+
# labels:
124+
# - 'traefik.backend=node'
125+
# - 'traefik.port=3000'
126+
# - 'traefik.frontend.rule=Host:front.panels_d8.docker.localhost'
127+
# expose:
128+
# - "3000"
129+
# volumes:
130+
# - ./path/to/your/single-page-app:/app
131+
# command: sh -c 'npm install && npm run start'
132+
133+
# memcached:
134+
# image: wodby/memcached:1.4-2.0.0
135+
136+
traefik:
137+
image: traefik
138+
command: -c /dev/null --web --docker --logLevel=INFO
139+
ports:
140+
- '8877:80'
141+
# - '8080:8080' # Dashboard
142+
volumes:
143+
- /var/run/docker.sock:/var/run/docker.sock
144+
145+
volumes:
146+
codebase:
147+
external: true

0 commit comments

Comments
 (0)