Skip to content

Commit ef9747d

Browse files
Improve base lagoon and lando setup
1 parent da3f4dc commit ef9747d

File tree

10 files changed

+33
-29
lines changed

10 files changed

+33
-29
lines changed

assets/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMPOSER_PROJECT_NAME=site-name

assets/.lando.base.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ recipe: lagoon
22
config:
33
flavor: drupal
44
env_file:
5+
- .env
56
- .lagoon.env
67

78
services:
89
appserver:
910
webroot: web
1011
type: php:8.2
12+
build_as_root:
13+
- mkdir -p /root/tmp
14+
- chmod 666 /root/tmp
15+
- mkdir -p /app/web/sites/simpletest/browser-output
16+
- chmod 777 -R /app/web/sites/simpletest
17+
- /usr/local/bin/composer self-update
1118
overrides:
1219
environment:
1320
PHP_IDE_CONFIG: serverName=localhost

assets/.lando.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ config:
44

55
tooling:
66
npm:
7-
service: nodebuilder
7+
service: cli
88
cmd: npm
99
dir: /app/web/themes/SITENAME
1010
gulp:
11-
service: nodebuilder
11+
service: cli
1212
cmd: gulp
1313
dir: /app/web/themes/SITENAME

assets/docker-compose.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ x-volumes:
99
x-environment:
1010
&default-environment
1111
# Route that should be used locally, if you are using pygmy, this route *must* end with .docker.amazee.io
12-
LAGOON_ROUTE: &default-url http://SITENAME.docker.amazee.io
13-
COMPOSER_VERSION: '2.0.4'
14-
COMPOSER_HASH_SHA256: '1cdc74f74965908d0e98d00feeca37c23b86da51170a3a11a1538d89ff44d4dd'
12+
LAGOON_ROUTE: &default-url http://${COMPOSE_PROJECT_NAME:-taoti-amazee}.docker.amazee.io
1513
# Uncomment if you like to have the system behave like in production
1614
#LAGOON_ENVIRONMENT_TYPE: production
1715
# Uncomment to enable xdebug and then restart via `docker-compose up -d`
@@ -34,7 +32,7 @@ services:
3432
build:
3533
context: .
3634
dockerfile: lagoon/cli.dockerfile
37-
image: &cli-image SITENAME-cli # this image will be reused as `CLI_IMAGE` in subsequent Docker builds
35+
image: &cli-image ${COMPOSE_PROJECT_NAME:-taoti-amazee}.-cli # this image will be reused as `CLI_IMAGE` in subsequent Docker builds
3836
labels:
3937
# Lagoon Labels
4038
lagoon.type: cli-persistent
@@ -92,7 +90,7 @@ services:
9290
<< : *default-environment # loads the defined environment variables from the top
9391

9492
mariadb:
95-
image: uselagoon/mariadb-drupal:latest
93+
image: uselagoon/mysql-8.0:latest
9694
labels:
9795
lagoon.type: mariadb
9896
lando.type: mariadb-drupal
@@ -101,16 +99,9 @@ services:
10199
<< : *default-user # uses the defined user from top
102100
environment:
103101
<< : *default-environment
104-
105-
nodebuilder:
106-
env_file:
107-
- .lagoon.env
108-
profiles:
109-
- nodebuilder # setup a profile so that the node builder doesn't run by default
110-
image: uselagoon/node-14-builder
111-
labels:
112-
lagoon.type: none
113-
<< : *default-volumes # loads the defined volumes from the top
102+
MYSQL_DATABASE: drupal
103+
MYSQL_USER: drupal
104+
MYSQL_PASSWORD: drupal
114105

115106
redis:
116107
image: amazeeio/redis:6-latest
@@ -135,6 +126,8 @@ services:
135126
- cli
136127
environment:
137128
<< : *default-environment
129+
volumes:
130+
- search:/var/solr
138131

139132
networks:
140133
amazeeio-network:

assets/lagoon/cli.dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM uselagoon/node-14-builder:latest as nodebuilder
1+
FROM uselagoon/node-20-builder:latest AS nodebuilder
22
COPY . /app
3-
RUN cd /app/web/themes/SITENAME && npm install --no-ansi && npx gulp --no-ansi
3+
RUN cd /app/web/themes/SITENAME && npm ci --no-ansi && npm run gulp --no-ansi
4+
5+
FROM uselagoon/php-8.2-cli-drupal:latest
6+
RUN apk add screen
47

5-
FROM uselagoon/php-7.4-cli-drupal:latest
68
COPY --from=nodebuilder /app /app
7-
RUN COMPOSER_MEMORY_LIMIT=-1 composer global remove hirak/prestissimo
8-
RUN COMPOSER_MEMORY_LIMIT=-1 composer self-update --2
99
RUN COMPOSER_MEMORY_LIMIT=-1 composer install --no-interaction --no-progress --optimize-autoloader --no-dev --no-ansi
1010
RUN mkdir -p -v -m766 /app/web/sites/default/files/private
1111
RUN chmod 444 /app/web/sites/default/settings.php

assets/lagoon/drush-override.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Lagoon global drush.yml file
2-
# This file tells Drush 9 about the lagoon environment
2+
# This file tells Drush about the lagoon environment
33

44
options:
55
root: '/app/${env.WEBROOT}'

assets/lagoon/nginx.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG CLI_IMAGE
2-
FROM ${CLI_IMAGE} as cli
2+
FROM ${CLI_IMAGE} AS cli
33

44
FROM uselagoon/nginx-drupal:latest
55

assets/lagoon/php.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG CLI_IMAGE
2-
FROM ${CLI_IMAGE} as cli
2+
FROM ${CLI_IMAGE} AS cli
33

44
FROM uselagoon/php-8.2-fpm:latest
55

assets/lagoon/solr.dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
ARG CLI_IMAGE
2-
FROM ${CLI_IMAGE} as cli
3-
4-
# Inspired by https://github.com/uselagoon/lagoon-images/pull/97
2+
FROM ${CLI_IMAGE} AS cli
53

64
FROM uselagoon/solr-8-drupal:latest
75
COPY --from=cli /app/config/solr-conf/ /solr-conf/conf

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@
4242
"mode": "replace",
4343
"path": "assets/docker-compose.yml",
4444
"overwrite": false
45-
}
45+
},
46+
"[project-root]/.env": {
47+
"mode": "replace",
48+
"path": "assets/.env",
49+
"overwrite": false
50+
},
4651
}
4752
}
4853
}

0 commit comments

Comments
 (0)