/
build.yml
129 lines (120 loc) · 4.74 KB
/
build.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
121
122
123
124
125
126
127
128
129
##
# Build and command-line operations containers for your local environment.
#
# @see https://docs.docker.com/compose/reference/overview/
# @see https://docs.docker.com/compose/compose-file/compose-file-v2/
##
version: '2.1'
services:
# Container for starting a cli for build commands
# Usage: docker-compose -f build.yml run --rm cli
cli:
extends:
service: operational
command: /bin/bash
# Container for composer commands
# Usage: docker-compose -f build.yml run --rm composer <command>
composer:
extends:
service: base
entrypoint: [ "/init", "composer", "--ansi" ]
command: ""
# Container for running drush in the docroot.
# Usage: docker-compose -f build.yml run --rm drush <command>
# Where <command> is a direct drush command like cache-rebuild
drush:
extends:
service: operational
entrypoint: [ "/init", "drush", "--root=/var/www/build/html", "--uri=www.d8.vm" ]
# Container for running Drupal Console in the docroot.
# Usage: docker-compose -f build.yml run --rm drupal <command>
# Where <command> is a direct drupal command like generate
# Note: Only works if the project includes Drupal Console as a composer dependency.
drupal:
extends:
service: operational
entrypoint: [ "/init", "/var/www/vendor/bin/drupal", "--ansi" ]
working_dir: /var/www/build/html
# Container for running grunt in the docroot.
# Usage: docker-compose -f build.yml run --rm grunt <command>
grunt:
extends:
service: operational
entrypoint: [ "/init", "grunt" ]
# Container for running PHPUnit tests.
# Usage: docker-compose -f build.yml run --rm phpunit <phpunit parameters>
# E.g. docker-compose -f build.yml run --rm phpunit -c ./core/phpunit.xml.dist ./modules/custom
phpunit:
extends:
service: operational
entrypoint: [ "/init", "/var/www/vendor/bin/phpunit" ]
working_dir: /var/www/build/html
# Operational base service definition for Local environment.
#
# Unlike `base`, this layer is functional for application interactions.
#
# Other services inherit these settings via the extends property.
# See https://docs.docker.com/compose/extends/#extending-services
operational:
extends:
service: base
external_links:
- drupal8_db:db
command: ""
# Base service definition for Local environment.
#
# This is not a fully operational build container, lacking access to other
# services such as the database or cache needed to properly interact with the
# application.
#
# Uses for this container include filesystem operations. For example:
#
# docker-compose -f build.yml run --rm base 'rm -Rf node_modules'
#
# Other services inherit these settings via the extends property.
# See https://docs.docker.com/compose/extends/#extending-services
base:
image: outrigger/build:php71
network_mode: "bridge"
entrypoint: [ "/init" ]
working_dir: /var/www
command: /bin/bash
environment:
# Check https://hub.docker.com/r/outrigger/build for other Node version options.
NODE_VERSION: 6
# Set to "true" to load xdebug configuration.
PHP_XDEBUG: "false"
# Centralized build cache configuration.
# This might move to the Docker build image.
NPM_CONFIG_CACHE: /root/.cache/npm
COMPOSER_CACHE_DIR: /root/.cache/composer
# PHPUnit variables.
SIMPLETEST_DB: mysql://admin:admin@db/drupal8
SIMPLETEST_URL: www.d8.vm
BROWSERTEST_OUTPUT_DIRECTORY: /tmp
labels:
# Unified lookup label for all containers for this project.
outrigger.project: drupal8
volumes:
# Use 'rig project sync' to leverage Outrigger Filesync for app code.
# @see http://docs.outrigger.sh/project-setup/filesystem-sync/
- drupal8-sync:/var/www
# Drupal files directory.
# This should be identical to the files volume in docker-compose.yml.
- /data/drupal8/files:/var/www/build/html/sites/default/files
# Persist the cache directories associated with various tools.
# The first volume mount covers: npm, composer, bower, fontconfig, & yarn
- /data/drupal8/cache:/root/.cache
- /data/drupal8/cache/drush:/root/.drush/cache
# Preserve BASH history across build container runs.
- /data/drupal8/${DOCKER_ENV:-local}/bash:/root/bash
# Uncomment this if you need to access private repositories, adjust to match your private key file location
# If you need to use an SSH key filename that is different from id_rsa, set it with:
# export OUTRIGGER_SHSH_KEY=drupal8_id_rsa
# ~/.ssh/${OUTRIGGER_SSH_KEY:-id_rsa}:/root/.ssh/outrigger.key
volumes:
# This defines the filesystem synchronization volume used for application
# code by the web container.
# @see <doc-url>
drupal8-sync:
external: true