This repository has been archived by the owner on Dec 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
120 lines (113 loc) · 5.39 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
version: "3.3"
services:
database:
# 10.2 is the default database because it has InnoDB 5.7, older versions are not supported by our modules.
# https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-767-bytes/41298282
image: ${DB_IMAGE:-wodby/mariadb:10.2}
container_name: "${PROJECT_NAME:-my_project}_database"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-password}
MYSQL_DATABASE: ${DB_NAME:-drupal}
MYSQL_USER: ${DB_USER:-drupal}
MYSQL_PASSWORD: ${DB_PASSWORD:-password}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
POSTGRES_DB: ${DB_NAME:-drupal}
POSTGRES_USER: ${DB_USER:-drupal}
volumes:
- database_data:/var/lib/mysql
php:
image: "${PHP_IMAGE:-wodby/drupal-php:7.2-dev}"
container_name: "${PROJECT_NAME:-my_project}_php"
working_dir: /mnt/files/local_mount
environment:
### DEVELOPMENT ENVIRONMENT ###
COLUMNS: 80
COMPOSER_DISABLE_XDEBUG_WARN: 1
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
# (Xdebug can be toggled in CI environments by settings these env vars.)
PHP_XDEBUG: ${PHP_XDEBUG:-1}
PHP_XDEBUG_DEFAULT_ENABLE: ${PHP_XDEBUG_DEFAULT_ENABLE:-1}
PHP_XDEBUG_REMOTE_CONNECT_BACK: 0
PHP_XDEBUG_IDEKEY: PHPSTORM
PHP_XDEBUG_MAX_NESTING_LEVEL: 400
PHP_IDE_CONFIG: serverName=docker
# This is the default IP of the docker0 interface on Linux.
# More details: https://wodby.com/docs/stacks/drupal/local/#xdebug
# (The default host can be overridden from .bashrc/.zshrc with this environment variable.)
PHP_XDEBUG_REMOTE_HOST: ${PHP_XDEBUG_REMOTE_HOST:-172.17.0.1} # Linux
# PHP_XDEBUG_REMOTE_HOST: host.docker.internal # Docker 18.03+ Mac/Win
# Share Composer authentication tokens from the host with the container.
# 0 as fallback value works thanks for this implementation:
# https://github.com/composer/composer/blob/79af9d45afb6bcaac8b73ae6a8ae24414ddf8b4b/src/Composer/Factory.php#L204
COMPOSER_AUTH: ${COMPOSER_AUTH:-0}
### TESTING ENVIRONMENT ###
# Run PHP-FPM as the default user (instead of www-data) to eliminate permission issues in testing.
PHP_FPM_USER: wodby
PHP_FPM_GROUP: wodby
DB_HOST: ${DB_HOST:-database}
DB_USER: ${DB_USER:-drupal}
DB_PASSWORD: ${DB_PASSWORD-password}
DB_NAME: ${DB_NAME:-drupal}
DB_DRIVER: ${DB_DRIVER:-mysql}
SIMPLETEST_BASE_URL: http://webserver
SIMPLETEST_DB: ${DB_DRIVER:-mysql}://${DB_USER:-drupal}:${DB_PASSWORD-password}@${DB_HOST:-database}/${DB_NAME:-drupal}
# Suppress deprecation warnings by default.
# https://api.drupal.org/api/drupal/vendor%21symfony%21phpunit-bridge%21DeprecationErrorHandler.php/8.5.x
SYMFONY_DEPRECATIONS_HELPER: ${SYMFONY_DEPRECATIONS_HELPER:-disabled}
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome",{"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless","--no-sandbox","--disable-dev-shm-usage"]}},"http://chrome:9515"]'
# This just sets the tmp folder for generated browser output files. If it is not set then no browser output is
# generated. The actual browser output is always saved to DRUPAL_ROOT . '/sites/simpletest/browser_output'.
# https://www.drupal.org/project/drupal/issues/2992069
BROWSERTEST_OUTPUT_DIRECTORY: "/tmp"
# Default configuration for Behat, Drupal Behat extension and others.
BEHAT_PARAMS: '{"extensions":{"Behat\\MinkExtension":{"base_url":"http://webserver","default_session":"selenium2","browser_name":"chrome","goutte":null,"selenium2":{"wd_host":"http://chrome:9515","browser":"chrome","capabilities":{"chrome":{"switches":["--disable-gpu","--headless","--no-sandbox","--disable-dev-shm-usage"]}}}},"Drupal\\DrupalExtension":{"blackbox":null,"api_driver":"drupal","drupal":{"drupal_root":"%paths.base%/web"},"drush":{"root":"%paths.base%/web"}},"Bex\\Behat\\ScreenshotExtension":{"image_drivers":{"local":{"screenshot_directory":"%paths.base%/behat/screenshosts"}}}}}'
volumes:
- .:/mnt/files/local_mount
webserver:
image: ${WEBSERVER_IMAGE:-wodby/nginx:1.17}
container_name: "${PROJECT_NAME:-my_project}_webserver"
ports:
- 80
depends_on:
- php
environment:
APACHE_BACKEND_HOST: php
APACHE_SERVER_ROOT: ${WEB_ROOT:-/mnt/files/local_mount/web}
NGINX_STATIC_CONTENT_OPEN_FILE_CACHE: "off"
NGINX_BACKEND_HOST: php
NGINX_VHOST_PRESET: drupal8
NGINX_SERVER_ROOT: ${WEB_ROOT:-/mnt/files/local_mount/web}
NGINX_STATIC_404_TRY_INDEX: 1
volumes:
- .:/mnt/files/local_mount
chrome:
image: drupalci/webdriver-chromedriver:production
container_name: "${PROJECT_NAME:-my_project}_chrome"
depends_on:
- webserver
ulimits:
core:
soft: -1
hard: -1
entrypoint:
- chromedriver
- "--log-path=/tmp/chromedriver.log"
- "--verbose"
- "--whitelisted-ips="
mailhog:
image: mailhog/mailhog
container_name: "${PROJECT_NAME:-my_project}_mailhog"
ports:
- 8025
node:
image: ${NODE_IMAGE:-wodby/node:12}
container_name: "${PROJECT_NAME:-my_project}_node"
command: "tail -f /dev/null"
# Should point to a directory with package.json.
working_dir: /mnt/files/local_mount
volumes:
- .:/mnt/files/local_mount
volumes:
# Persistent database storage.
database_data: