-
Notifications
You must be signed in to change notification settings - Fork 20
/
.lando.yml
262 lines (234 loc) · 8.62 KB
/
.lando.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
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
# This is the configuration file for the local development
# environment, managed by Lando (https://lando.dev/)
# This setup covers both the backend (by using the drupal recipe),
# and the frontend, by adding a node service.
name: next-drupal-starterkit
recipe: drupal10
config:
php: "8.2"
via: nginx
webroot: drupal/web
database: "mariadb:10.4"
composer_version: 2
xdebug: off
config:
php: .lando/php.ini
tooling:
grumphp:
description: "Runs grumphp commands"
cmd:
- appserver: ./drupal/vendor/bin/grumphp
npm:
description: "Runs npm commands"
service: node
dir: /app/next
npx:
service: node
dir: /app/next
# This command will stop (kill) any running node operations
# in the node container in lando. You can use it instead of the
# usual ctrl-c keyboard combination.
npm-stop:
cmd:
- node: kill $(ps aux | grep 'npm\|node' | awk '{print $2}')
composer:
dir: /app/drupal
drush:
cmd: /app/drupal/vendor/bin/drush
phpunit:
description: Runs PHPUnit commands
user: www-data
cmd:
- appserver: "php /app/drupal/vendor/bin/phpunit -c /app/drupal/phpunit.xml --testdox"
regenerate-phpunit-config:
description: "Regenerates fresh PHPUnit configuration."
cmd:
- appserver: /app/.lando/phpunit.sh
xdebug:
description: "Loads Xdebug in the selected mode"
cmd:
- appserver: /app/.lando/xdebug.sh
user: root
# This custom message allows you to install a drupal recipe from the
# /drupal/recipes folder. Drupal recipes are a new feature that is bein
# added to Drupal10 as a core initiative.
install-recipe:
description: "Installs the specified recipe. Accepts the recipe folder name. Recipes should be stored in /recipes"
cmd:
- appserver: /app/.lando/install_recipe.sh
dir: /app/drupal/web
user: www-data
# This custom command can be used to automatically generate keys for the simple_oauth module.
generate-oauth-keys:
description: "Generates a pair of public and private keys into the oauth directory"
cmd:
- appserver: /app/.lando/generate_oauth_keys.sh
dir: /app/drupal/oauth
user: www-data
redis-cli:
cmd:
- cache: redis-cli -h cache -p 6379 -a mypassword
services:
database:
# This is the port you can use to connect to mysql from your host.
portforward: 34567
# This service will handle the backend (php) part of the application.
appserver:
# Install dependencies when building lando.
build:
- "cd drupal && composer install"
- echo "export PATH=/app/drupal/vendor/bin:${PATH}" >> /var/www/.bashrc
overrides:
environment:
# URL OF THE FRONTEND SITE:
# This needs to match the proxy value for the node service
# so if you change it, remember to change it here as well.
WUNDER_NEXT_FRONTEND_URL: https://frontend.lndo.site
# This is the secret that is used by the backend to tell the frontend
# to revalidate specific paths. The values need to match both in frontend
# and backend.
DRUPAL_REVALIDATE_SECRET: revalidate_secret_not_secure_used_only_locally
# This is the secret that is used by the frontend to issue calls to Drupal.
# The values need to match both in frontend and backend.
DRUPAL_CLIENT_SECRET: drupal_client_secret_not_secure_used_only_locally
# The client id, specified in the consumer on the Drupal side.
DRUPAL_CLIENT_ID: drupal-client-id
# The client id for the unprivileged user, specified in the consumer on the Drupal side.
DRUPAL_CLIENT_VIEWER_ID: drupal-client-viewer-id
DRUPAL_CLIENT_VIEWER_SECRET: drupal_client_viewer_secret_not_secure_used_only_locally
HASH_SALT: notsosecurehashnotsosecurehashnotsosecurehash
ENVIRONMENT_NAME: lando
DB_NAME_DRUPAL: drupal10
DB_USER_DRUPAL: drupal10
DB_PASS_DRUPAL: drupal10
DB_HOST_DRUPAL: database
DRUSH_OPTIONS_URI: https://next-drupal-starterkit.lndo.site
# Support debugging with XDEBUG 3.
XDEBUG_MODE:
PHP_IDE_CONFIG: serverName=appserver
# PHPUnit settings. @see: .lando/phpunit.sh
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless"]}}, "http://chrome:9515"]'
# This service handles the frontend part of the application
node:
type: node:20
ssl: true
sslExpose: true
globals:
npm: latest
overrides:
image: "cypress/included:cypress-13.6.4-node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1"
ports:
- "3000:3000"
- "6006:6006"
environment:
# Having these values here will make the frontend site work
# out of the box when building and using the frontend site
# via lando npm, without the need of an .env.local file.
# The values need to match what is defined in the `appserver` service
# above.
# You should add new env vars to `next/.env.ts` to ensure type safety with zod.
DRUPAL_REVALIDATE_SECRET: revalidate_secret_not_secure_used_only_locally
DRUPAL_CLIENT_SECRET: drupal_client_secret_not_secure_used_only_locally
DRUPAL_CLIENT_ID: drupal-client-id
DRUPAL_CLIENT_VIEWER_ID: drupal-client-viewer-id
DRUPAL_CLIENT_VIEWER_SECRET: drupal_client_viewer_secret_not_secure_used_only_locally
NEXT_PUBLIC_DRUPAL_BASE_URL: https://next-drupal-starterkit.lndo.site
NEXT_IMAGE_DOMAIN: next-drupal-starterkit.lndo.site
NEXT_PUBLIC_FRONTEND_URL: https://frontend.lndo.site
# Environment variables for next_auth:
# Environment variables for next_auth:
AUTH_SECRET: nextauth_secret_not_secure_used_only_locally
AUTH_TRUST_HOST: true
AUTH_URL: https://frontend.lndo.site
REDIS_HOST: redis
REDIS_PASS: "mypassword"
ES_HOST: elasticsearch
# To enable nesh cache debugging
# NEXT_PRIVATE_DEBUG_CACHE: 1
build:
- "cd next && npm ci"
scanner: false
# This service adds elasticsearch, used by (you guessed it) the search part of
# the application.
elasticsearch:
type: lando
services:
image: "docker.elastic.co/elasticsearch/elasticsearch:8.10.2"
command: "/bin/tini -- /usr/local/bin/docker-entrypoint.sh eswrapper"
user: elasticsearch
environment:
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
discovery.type: "single-node"
bootstrap.memory_lock: "true"
http.cors.enabled: "true"
http.cors.allow-origin: "'*'"
# Disable authentication in local development
xpack.security.enabled: "false"
xpack.security.enrollment.enabled: "false"
ulimits:
memlock:
soft: "-1"
hard: "-1"
ports:
- "9200:9200"
volumes:
- esdata:/usr/share/elasticsearch/data
# Install ES plugins.
build_as_root:
- elasticsearch-plugin install analysis-icu
volumes:
esdata:
driver: local
# The Elasticvue service can be used to monitor and issue queries to elasticsearch.
elasticvue:
type: lando
services:
image: "cars10/elasticvue:1.0.4"
command: /docker-entrypoint.sh nginx -g 'daemon off;'
ports:
- "8080:8080"
environment:
ELASTICVUE_CLUSTERS: '[{"name": "dev cluster", "uri": "http://localhost:9200", "password": "", "user": ""}]'
# Uncomment this section if you prefer to use the more advanced Kibana tool with Elasticsearch:
#
# kibana:
# type: lando
# services:
# image: "docker.elastic.co/kibana/kibana:7.17.0"
# command: "/bin/tini -- /usr/local/bin/kibana-docker"
# user: kibana
# ports:
# - "5601:5601"
# Any emails generated by Drupal will be caught by this service, and
# can be seen in the browser.
mailhog:
type: mailhog
hogfrom:
- appserver
# This service adds redis, used by the frontend application for caching.
redis:
type: redis:7
persist: true
password: mypassword
portforward: 6379
# This section specifies at which urls each service is available. Adjust as necessary
# for your project.
proxy:
mailhog:
- mail.lndo.site
elasticvue:
- elasticvue.lndo.site:8080
node:
# This value is used by the appserver service to connect to the frontend
# so make sure that this value and the WUNDER_NEXT_FRONTEND_URL env var are
# in sync.
- frontend.lndo.site:3000
# kibana:
# - kibana.lndo.site:5601
events:
post-db-import:
- appserver: "cd $LANDO_WEBROOT && drush cache:rebuild -y && drush @local user:login"
env_file:
- .lando/.env
# Tested with Lando version
version: v3.22.3