forked from drevops/vortex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
282 lines (265 loc) Β· 9.26 KB
/
docker-compose.yml
File metadata and controls
282 lines (265 loc) Β· 9.26 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
#: Docker Compose configuration file.
#:
#: - Using a single file to work in local, CI and production environments.
#: - Local overrides are possible using docker-composer.override.yml file.
#: - Environment variables are read from .env file.
#; - Use inline comments containing '###' to have the line removed in CI.
#; - Use inline comments starting with '##' to have the line being automatically
#; uncommented in CI.
#; - Comments starting with '#;', '#;<' or '#;>' (like the ones used for the
#; current paragraph) are explaining DrevOps inner workings and can be
#; safely removed for your project. They are automatically removed when
#; installing or updating DrevOps.
version: '2.3'
# ------------------------------------------------------------------------------
# Variable aliases.
# ------------------------------------------------------------------------------
#: Project name. Used in multiple places to name built Docker images.
#: Do not change here, instead update .env file.
x-project:
&project ${PROJECT:-your_site}
#: Volumes available in each container to share application data.
x-volumes:
&default-volumes
#: Understanding host mounting in Docker-based projects.
#:
#: To share application code between services (containers), Docker uses volumes.
#: When used in non-development environments, containers have access to
#: the same shared files using volumes and these volumes do not need to be
#: mounted from the host. But for development environment, when the code
#: constantly changes on the host, we need to have these changes synchronized
#: into all containers. Since we are using single `docker-compose.yml` file for
#: all environments, we have to accommodate both cases, so we are specifying an
#: override for the same directory as a mounted volume as a commented-out lines,
#: which will be automatically uncommented in CI.
#:
#: See Docker Compose reference about volumes https://docs.docker.com/compose/compose-file/compose-file-v2/#volume-configuration-reference
volumes:
#:
#: All application files mounted into container.
- .:/app:${VOLUME_FLAGS:-delegated} ### Local overrides to mount host filesystem. Automatically removed in CI and PROD.
#:
#: Override mount for files to allow different type of syncing to optimise
#: performance.
- ./docroot/sites/default/files:/app/docroot/sites/default/files:${VOLUME_FLAGS:-delegated} ### Local overrides to mount host filesystem. Automatically removed in CI and PROD.
#:
#: Use the same volumes in environments without host mounts support.
##- app:/app # Override for environment without host mounts. Automatically uncommented in CI.
##- files:/app/docroot/sites/default/files # Override for environment without host mounts. Automatically uncommented in CI.
#: The default user under which the containers should run.
x-user:
&default-user
# Change this if you are on linux and run with another user than id `1000`
user: '1000'
#: Environment variables set in all containers during build and runtime.
#: Do not change values here, instead modify .env file.
x-environment:
&default-environment
#:
#: Local development URL. Required to make DNS request route correctly.
#: Do not change the default value here (it is set as a fallback). Instead,
#: change the value in .env file.
LAGOON_LOCALDEV_URL: &default-url ${LOCALDEV_URL:-your-site.docker.amazee.io}
#; Amazeeio images require Lagoon route for Drush 9+ alias configuration.
LAGOON_ROUTE: *default-url
#:
#: Allow to enable XDebug by setting external environment variable.
#: Do not change the value here. Instead, use
#: ahoy debug
#: or
#: XDEBUG_ENABLE=1 docker-compose up -d
XDEBUG_ENABLE: ${XDEBUG_ENABLE:-}
#:
#: Pass-through $CI variable used to identify the CI environment.
CI: ${CI:-}
#;< LAGOON
#:
#: Re-using global project name for Lagoon.
LAGOON_PROJECT: *project
#:
#: Allow to override Lagoon environment type, defaulting it to 'local'.
LAGOON_ENVIRONMENT_TYPE: ${LAGOON_ENVIRONMENT_TYPE:-local}
#;> LAGOON
# ------------------------------------------------------------------------------
# Services.
# ------------------------------------------------------------------------------
services:
#: CLI container.
cli:
#:
#: Build docker image to add application files into container.
build:
context: .
dockerfile: .docker/Dockerfile.cli
#:
#: The name of the Docker image is the name of the project.
image: *project
<<: *default-volumes
user: root
environment:
<<: *default-environment
#: Mount volumes from Pygmy to inject host SSH key into container.
#: https://pygmy.readthedocs.io/en/master/ssh_agent/
volumes_from: ### Local overrides to mount host SSH keys. Automatically removed in CI.
- container:amazeeio-ssh-agent ### Local overrides to mount host SSH keys. Automatically removed in CI.
ports:
#:
#: Livereload port.
#: Find port on host with `ahoy info` or `docker-compose port cli 35729`.
- "35729"
#;< LAGOON
#: https://lagoon.readthedocs.io/en/latest/using_lagoon/service_types/#service-types
labels:
lagoon.type: cli-persistent
lagoon.persistent.name: nginx-php
lagoon.persistent: /app/docroot/sites/default/files/
#;> LAGOON
#: Nginx container.
nginx:
#:
#: Build docker image to add application files into container.
build:
context: .
dockerfile: .docker/Dockerfile.nginx-drupal
args:
CLI_IMAGE: *project
<<: *default-volumes
<<: *default-user
environment:
<<: *default-environment
depends_on:
- cli
networks:
#:
#: This network is supported by Pygmy and used to route all requests to
#: host machine.
- amazeeio-network
#:
#: This is a standard network and is used for all other environments, where
#: requests routing is not required and/or not supported.
- default
#;< LAGOON
#: https://lagoon.readthedocs.io/en/latest/using_lagoon/service_types/#service-types
labels:
lagoon.type: nginx-php-persistent
lagoon.name: nginx-php
lagoon.persistent: /app/docroot/sites/default/files/
lagoon.persistent.class: slow
#;> LAGOON
#: PHP FPM container.
#: All web requests going to this container.
php:
#:
#: Build docker image to add application files into container.
build:
context: .
dockerfile: .docker/Dockerfile.php
args:
CLI_IMAGE: *project
<<: *default-volumes
<<: *default-user
environment:
<<: *default-environment
depends_on:
- cli
#;< LAGOON
#: https://lagoon.readthedocs.io/en/latest/using_lagoon/service_types/#service-types
labels:
lagoon.type: nginx-php-persistent
lagoon.name: nginx-php
lagoon.persistent: /app/docroot/sites/default/files/
lagoon.persistent.class: slow
#;> LAGOON
#: Database container.
mariadb:
#:
#: Build docker image to add application files into container.
build:
context: .
dockerfile: .docker/Dockerfile.mariadb
args:
IMAGE: "${DATABASE_IMAGE:-amazeeio/mariadb-drupal:20.10.0}"
environment:
<<: *default-environment
ports:
#:
#: MariaDB port.
#: Find port on host with `ahoy info` or `docker-compose port mariadb 3306`.
- "3306"
#;< LAGOON
#: https://lagoon.readthedocs.io/en/latest/using_lagoon/service_types/#service-types
#: Make sure to destroy and re-deploy an environment if this value changes.
labels:
lagoon.type: mariadb
#;> LAGOON
#;< REDIS
#: Redis container.
#: Used for caching.
redis:
image: amazeeio/redis:6-20.10.0
#;< LAGOON
#: https://lagoon.readthedocs.io/en/latest/using_lagoon/service_types/#service-types
labels:
lagoon.type: redis
#;> LAGOON
#;> REDIS
#;< SOLR
#: Search engine container.
solr:
#:
#: Build docker image to apply modifications required for this application.
build:
context: .
dockerfile: .docker/Dockerfile.solr
args:
CLI_IMAGE: *project
<<: *default-user
environment:
<<: *default-environment
ports:
#:
#: Solr port.
#: Find port on host with `ahoy info` or `docker-compose port solr 8983`.
- "8983"
#;< LAGOON
#: https://lagoon.readthedocs.io/en/latest/using_lagoon/service_types/#service-types
labels:
lagoon.type: solr
#;> LAGOON
#;> SOLR
#: Chrome container.
#: Used for browser testing.
chrome:
# Pinned to specific image version until https://github.com/drevops/drevops/issues/534 is resolved.
image: selenium/standalone-chrome:3.141.59-oxygen
#:
#: Increase '/dev/shm' partition size to avoid browser crashing.
shm_size: '1gb'
#:
#: Use default volumes to provide access to test fixtures.
<<: *default-volumes
environment:
<<: *default-environment
depends_on:
- cli
#;< LAGOON
labels:
lagoon.type: none
#;> LAGOON
#: Wait for services to become available.
wait_dependencies:
image: dadarek/wait-for-dependencies
depends_on:
- cli
- mariadb
command: mariadb:3306
#;< LAGOON
labels:
lagoon.type: none
#;> LAGOON
networks:
amazeeio-network:
external: true
volumes:
app: {}
files: {}