Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(dev-env): bypass Lando entrypoint for auxiliary images #2135

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 13 additions & 42 deletions assets/dev-env.lando.template.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -122,69 +120,62 @@ 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:
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
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
PMA_PORT: 3306
PMA_USER: root
PMA_PASSWORD: ''
UPLOAD_LIMIT: 4G
LANDO_NO_USER_PERMS: 1
LANDO_NEEDS_EXEC: 1
ports:
- 127.0.0.1::80
volumes:
- pma_www:/var/www/html
volumes:
pma_www:
entrypoint: /docker-entrypoint.sh apache2-foreground
<% } %>

<% if ( elasticsearch ) { %>
elasticsearch:
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'
ELASTICSEARCH_NODE_NAME: 'lando'
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:
Expand All @@ -193,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/

Expand All @@ -206,28 +192,19 @@ 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
source: scripts
target: /scripts
volume:
nocopy: true
environment:
LANDO_NO_SCRIPTS: 1
LANDO_NEEDS_EXEC: 1
volumes:
mu-plugins: {}
initOnly: true
entrypoint: /usr/bin/rsync -a --delete-after --chown=${LANDO_HOST_USER_ID}:${LANDO_HOST_GROUP_ID} /mu-plugins/ /shared/
<% } %>

<% if ( appCode.mode == 'image' ) { %>
demo-app-code:
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
Expand All @@ -245,34 +222,28 @@ services:
clientcode_themes: {}
clientcode_vipconfig: {}
initOnly: true
entrypoint: /bin/true
<% } %>

<% if ( mailpit ) { %>
mailpit:
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 ) { %>
photon:
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:
Expand Down
2 changes: 1 addition & 1 deletion src/lib/constants/dev-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Loading