This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
153 lines (140 loc) · 4.57 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
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
# 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.
# - Use inline comments starting with ### to have the line removed in CI.
version: '2.3'
x-bay-image-version:
&bay-image-version ${BAY_IMAGE_VERSION:-5.x}
x-project:
&project ${PROJECT_NAME:-mysite}
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:
- .:/app:${VOLUME_FLAGS:-delegated} ### Local overrides to mount host filesystem. Automatically removed in CI and PROD.
- ./docroot/sites/default/files:/app/docroot/sites/default/files:${VOLUME_FLAGS:-delegated} ### Local overrides to mount host filesystem. Automatically removed in CI and PROD.
##- app:/app
##- files:/app/docroot/sites/default/files
x-environment:
&default-environment
LAGOON_PROJECT: *project
# Local dev URL populated from the environment. Do not override here. Instead,
# specify the value in .env file.
LAGOON_LOCALDEV_URL: ${LOCALDEV_URL:-http://mysite.docker.amazee.io}
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
BAY_KEY: ${BAY_KEY:-}
BAY_IMAGE_VERSION: ${BAY_IMAGE_VERSION:-5.x}
LAGOON_ENVIRONMENT_TYPE: ${LAGOON_ENVIRONMENT_TYPE:-local}
DRUPAL_REFRESH_SEARCHAPI: ${DRUPAL_REFRESH_SEARCHAPI:-}
# Uncomment to enable Xdebug and then restart via `ahoy up`.
#XDEBUG_ENABLE: "true"
DOCKERHOST: host.docker.internal
services:
cli:
build:
context: .
dockerfile: .docker/Dockerfile.cli
args:
COMPOSER: ${COMPOSER:-composer.json}
BAY_IMAGE_VERSION: *bay-image-version
image: *project
environment:
<< : *default-environment
COMPOSER_MEMORY_LIMIT: -1
<< : *default-volumes
labels:
lagoon.type: cli-persistent
lagoon.persistent: /app/docroot/sites/default/files/
lagoon.persistent.name: nginx-php
nginx:
build:
context: .
dockerfile: .docker/Dockerfile.nginx-drupal
args:
CLI_IMAGE: *project
BAY_IMAGE_VERSION: *bay-image-version
<< : *default-volumes
environment:
<< : *default-environment
depends_on:
- cli
labels:
lagoon.type: nginx-php-persistent
lagoon.persistent: /app/docroot/sites/default/files/
lagoon.persistent.class: slow
lagoon.name: nginx-php
expose:
- "8080"
php:
build:
context: .
dockerfile: .docker/Dockerfile.php
args:
CLI_IMAGE: *project
BAY_IMAGE_VERSION: *bay-image-version
environment:
<< : *default-environment
<< : *default-volumes
depends_on:
- cli
labels:
lagoon.type: nginx-php-persistent
lagoon.persistent: /app/docroot/sites/default/files/
lagoon.persistent.class: slow
lagoon.name: nginx-php
mariadb:
image: singledigital/bay-mariadb:${BAY_IMAGE_VERSION:-5.x}
ports:
- "3306" # Find port on host with `ahoy info` or `docker-compose port mariadb 3306`
labels:
lagoon.type: mariadb-shared
redis:
image: uselagoon/redis-5:latest
labels:
lagoon.type: redis
elasticsearch:
ports:
- "9200:9200"
build:
context: .
dockerfile: .docker/Dockerfile.elasticsearch
args:
- ES_TPL=${ES_TPL:-elasticsearch.yml}
labels:
lagoon.type: none
chrome:
image: seleniarm/standalone-chromium:101.0
shm_size: '1gb'
environment:
<<: *default-environment
<<: *default-volumes
depends_on:
- cli
labels:
lagoon.type: none
proxy:
image: caddy:latest
restart: unless-stopped
ports:
- "${LOCAL_PORT:-80}:80"
volumes:
- $PWD/.docker:/etc/caddy
- $PWD/.docker/Caddyfile:/etc/caddy/Caddyfile
labels:
lagoon.type: none
volumes:
app: {}
files: {}