From c7796e4c92ba605381103f14837629b113d00225 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Wed, 4 Dec 2024 15:32:50 +0200 Subject: [PATCH 1/5] refactor(dev-env): bypass Lando entrypoint for auxiliary images --- assets/dev-env.lando.template.yml.ejs | 26 ++++++-------------------- src/lib/constants/dev-environment.ts | 2 +- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/assets/dev-env.lando.template.yml.ejs b/assets/dev-env.lando.template.yml.ejs index bfcc12bed..6b2c1c74c 100644 --- a/assets/dev-env.lando.template.yml.ejs +++ b/assets/dev-env.lando.template.yml.ejs @@ -134,18 +134,13 @@ services: type: compose services: image: memcached:1.6-alpine - command: memcached -m 64 - environment: - LANDO_NO_USER_PERMS: 1 - LANDO_NO_SCRIPTS: 1 - LANDO_NEEDS_EXEC: 1 + entrypoint: /usr/local/bin/memcached -m 64 <% if ( phpmyadmin ) { %> phpmyadmin: type: compose services: image: phpmyadmin:5 - command: /docker-entrypoint.sh apache2-foreground environment: MYSQL_ROOT_PASSWORD: '' PMA_HOSTS: database @@ -161,6 +156,7 @@ services: - pma_www:/var/www/html volumes: pma_www: + entrypoint: /docker-entrypoint.sh apache2-foreground <% } %> <% if ( elasticsearch ) { %> @@ -168,7 +164,6 @@ services: type: compose services: image: elasticsearch:7.17.8 - command: /usr/local/bin/docker-entrypoint.sh environment: ELASTICSEARCH_IS_DEDICATED_NODE: 'no' ELASTICSEARCH_CLUSTER_NAME: 'bespin' @@ -176,15 +171,13 @@ services: ELASTICSEARCH_PORT_NUMBER: 9200 discovery.type: 'single-node' xpack.security.enabled: 'false' - LANDO_NO_USER_PERMS: 1 - LANDO_NO_SCRIPTS: 1 - LANDO_NEEDS_EXEC: 1 ports: - ":9200" volumes: - search_data:/usr/share/elasticsearch/data volumes: search_data: + entrypoint: /usr/local/bin/docker-entrypoint.sh <% } %> wordpress: @@ -227,7 +220,6 @@ services: type: compose services: image: ghcr.io/automattic/vip-container-images/skeleton:latest - command: exit 0 volumes: - clientcode_clientmuPlugins:/clientcode/client-mu-plugins - clientcode_images:/clientcode/images @@ -245,6 +237,7 @@ services: clientcode_themes: {} clientcode_vipconfig: {} initOnly: true + entrypoint: /bin/true <% } %> <% if ( mailpit ) { %> @@ -252,13 +245,10 @@ services: type: compose services: image: axllent/mailpit:latest - command: /mailpit ports: - ":1025" - ":8025" - environment: - LANDO_NO_USER_PERMS: 1 - LANDO_NEEDS_EXEC: 1 + entrypoint: /mailpit <% } %> <% if ( photon ) { %> @@ -266,13 +256,9 @@ services: type: compose services: image: ghcr.io/automattic/vip-container-images/photon:latest - command: /usr/sbin/php-fpm - environment: - LANDO_NO_USER_PERMS: 1 - LANDO_NO_SCRIPTS: 1 - LANDO_NEEDS_EXEC: 1 volumes: - ./uploads:/usr/share/webapps/photon/uploads:ro + entrypoint: /usr/sbin/php-fpm <% } %> tooling: diff --git a/src/lib/constants/dev-environment.ts b/src/lib/constants/dev-environment.ts index 196c86fb7..316b2a3bf 100644 --- a/src/lib/constants/dev-environment.ts +++ b/src/lib/constants/dev-environment.ts @@ -49,4 +49,4 @@ export const DEV_ENVIRONMENT_DEFAULTS = { phpVersion: Object.keys( DEV_ENVIRONMENT_PHP_VERSIONS )[ 0 ], } as const; -export const DEV_ENVIRONMENT_VERSION = '2.1.3'; +export const DEV_ENVIRONMENT_VERSION = '2.1.4'; From dc04de0baaf146ae2950efb345f2ab8ad3490382 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Sat, 14 Dec 2024 00:24:58 +0200 Subject: [PATCH 2/5] refactor: update `database` service --- assets/dev-env.lando.template.yml.ejs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/dev-env.lando.template.yml.ejs b/assets/dev-env.lando.template.yml.ejs index 6b2c1c74c..07f793fe2 100644 --- a/assets/dev-env.lando.template.yml.ejs +++ b/assets/dev-env.lando.template.yml.ejs @@ -110,10 +110,8 @@ services: services: <% if ( mariadb ) { %> image: mariadb:<%= mariadb %> - command: docker-entrypoint.sh mysqld --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --max_allowed_packet=67M <% } else { %> image: mysql:8.4 - command: docker-entrypoint.sh mysqld --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION --max_allowed_packet=67M --mysql-native-password=ON <% } %> ports: - ":3306" @@ -129,6 +127,11 @@ services: - database_data:/var/lib/mysql volumes: database_data: +<% if ( mariadb ) { %> + entrypoint: docker-entrypoint.sh mysqld --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --max_allowed_packet=67M +<% } else { %> + entrypoint: docker-entrypoint.sh mysqld --sql-mode=ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION --max_allowed_packet=67M --mysql-native-password=ON +<% } %> memcached: type: compose From 42ca17d1d3d2f6c35d8d7b6b0815d7f2051ca597 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Sat, 14 Dec 2024 00:27:54 +0200 Subject: [PATCH 3/5] refactor: update `vip-mu-plugins` service --- assets/dev-env.lando.template.yml.ejs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/assets/dev-env.lando.template.yml.ejs b/assets/dev-env.lando.template.yml.ejs index 07f793fe2..a26ad2197 100644 --- a/assets/dev-env.lando.template.yml.ejs +++ b/assets/dev-env.lando.template.yml.ejs @@ -76,7 +76,7 @@ services: condition: service_completed_successfully <% if ( muPlugins.mode == 'image' ) { %> vip-mu-plugins: - condition: service_started + condition: service_completed_successfully <% } %> <% if ( appCode.mode == 'image' ) { %> demo-app-code: @@ -202,7 +202,6 @@ services: type: compose services: image: ghcr.io/automattic/vip-container-images/mu-plugins:0.1 - command: sh /run.sh volumes: - mu-plugins:/shared - type: volume @@ -210,12 +209,10 @@ services: target: /scripts volume: nocopy: true - environment: - LANDO_NO_SCRIPTS: 1 - LANDO_NEEDS_EXEC: 1 volumes: mu-plugins: {} initOnly: true + entrypoint: /run.sh <% } %> <% if ( appCode.mode == 'image' ) { %> From 9a2ec3f773c1af4a442cd41a9b124b3666837d09 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Sat, 14 Dec 2024 03:09:05 +0200 Subject: [PATCH 4/5] refactor: update `entrypoint` for `vip-mu-plugins` --- assets/dev-env.lando.template.yml.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/dev-env.lando.template.yml.ejs b/assets/dev-env.lando.template.yml.ejs index a26ad2197..0f3588545 100644 --- a/assets/dev-env.lando.template.yml.ejs +++ b/assets/dev-env.lando.template.yml.ejs @@ -212,7 +212,7 @@ services: volumes: mu-plugins: {} initOnly: true - entrypoint: /run.sh + entrypoint: /usr/bin/rsync -a --delete-after --chown=${LANDO_HOST_USER_ID}:${LANDO_HOST_GROUP_ID} /mu-plugins/ /shared/ <% } %> <% if ( appCode.mode == 'image' ) { %> From 8b91294d8d3cc2e24fed86f028388992db0903a9 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Wed, 18 Dec 2024 02:00:40 +0200 Subject: [PATCH 5/5] refactor: remove not used volumes and env vars --- assets/dev-env.lando.template.yml.ejs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/assets/dev-env.lando.template.yml.ejs b/assets/dev-env.lando.template.yml.ejs index 0f3588545..0361328a6 100644 --- a/assets/dev-env.lando.template.yml.ejs +++ b/assets/dev-env.lando.template.yml.ejs @@ -120,9 +120,6 @@ services: MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress MYSQL_DATABASE: wordpress - LANDO_NO_USER_PERMS: 1 - LANDO_NO_SCRIPTS: 1 - LANDO_NEEDS_EXEC: 1 volumes: - database_data:/var/lib/mysql volumes: @@ -151,8 +148,6 @@ services: PMA_USER: root PMA_PASSWORD: '' UPLOAD_LIMIT: 4G - LANDO_NO_USER_PERMS: 1 - LANDO_NEEDS_EXEC: 1 ports: - 127.0.0.1::80 volumes: @@ -189,11 +184,6 @@ services: image: ghcr.io/automattic/vip-container-images/wordpress:<%= wordpress.tag %> volumes: - ./wordpress:/shared - - type: volume - source: scripts - target: /scripts - volume: - nocopy: true initOnly: true entrypoint: /usr/bin/rsync -a --chown=${LANDO_HOST_USER_ID}:${LANDO_HOST_GROUP_ID} /wp/ /shared/ @@ -204,11 +194,6 @@ services: image: ghcr.io/automattic/vip-container-images/mu-plugins:0.1 volumes: - mu-plugins:/shared - - type: volume - source: scripts - target: /scripts - volume: - nocopy: true volumes: mu-plugins: {} initOnly: true