Skip to content

Commit

Permalink
refactor(dev-env): make wordpress init-only container
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Dec 8, 2024
1 parent 0a24901 commit ebc9089
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 6 additions & 6 deletions assets/dev-env.lando.template.yml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,19 @@ services:
type: compose
services:
image: ghcr.io/automattic/vip-container-images/wordpress:<%= wordpress.tag %>
# command: /usr/local/bin/entrypoint.sh
command: sh -c "rsync -a --chown=www-data:www-data /wp/ /shared/; sleep infinity"
volumes:
- ./wordpress:/shared
- type: volume
source: scripts
target: /scripts
volume:
nocopy: true
# environment:
# LANDO_NO_SCRIPTS: 1
# LANDO_NEEDS_EXEC: 1
# initOnly: true
environment:
LANDO_NO_USER_PERMS: 1
LANDO_NO_SCRIPTS: 1
LANDO_NEEDS_EXEC: 1
initOnly: true
entrypoint: /usr/bin/rsync -a --chown=${LANDO_HOST_USER_ID}:${LANDO_HOST_GROUP_ID} /wp/ /shared/

<% if ( muPlugins.mode == 'image' ) { %>
vip-mu-plugins:
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.2';
export const DEV_ENVIRONMENT_VERSION = '2.1.3';
6 changes: 5 additions & 1 deletion src/lib/dev-environment/dev-environment-lando.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import landoUtils, { type AppInfo } from 'lando/plugins/lando-core/lib/utils';
import landoBuildTask from 'lando/plugins/lando-tooling/lib/build';
import { lookup } from 'node:dns/promises';
import { mkdir, rename } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { tmpdir, userInfo } from 'node:os';
import path, { dirname } from 'node:path';
import { satisfies } from 'semver';
import xdgBasedir from 'xdg-basedir';
Expand Down Expand Up @@ -89,6 +89,10 @@ async function getLandoConfig(): Promise< LandoConfig > {
home: fakeHomeDir,
domain: 'vipdev.lndo.site',
version: 'unknown',
env: {
LANDO_HOST_USER_ID: process.platform === 'win32' ? '1000' : `${ userInfo().uid }`,
LANDO_HOST_GROUP_ID: process.platform === 'win32' ? '1000' : `${ userInfo().gid }`,
},
};

return buildConfig( config );
Expand Down

0 comments on commit ebc9089

Please sign in to comment.