diff --git a/packages/local-refresh/src/actions/ComposerInstall.ts b/packages/local-refresh/src/actions/ComposerInstall.ts index 6245aa7c7b..79928ae5ac 100644 --- a/packages/local-refresh/src/actions/ComposerInstall.ts +++ b/packages/local-refresh/src/actions/ComposerInstall.ts @@ -12,6 +12,8 @@ const phpAppDirectoryNames = ["api", "selfserve", "internal"]; const phpAppDirectories = phpAppDirectoryNames.map((dir) => path.resolve(__dirname, `../../../../app/${dir}`)); export default class ComposerInstall implements ActionInterface { + private ignorePlatformReqs: boolean = false; + async prompt(): Promise { const { shouldInstall } = await prompts({ type: "confirm", @@ -19,6 +21,17 @@ export default class ComposerInstall implements ActionInterface { message: "Install Composer dependencies?", }); + if (shouldInstall) { + const { ignoreReqs } = await prompts({ + type: "confirm", + name: "ignoreReqs", + message: "Do you want to add the --ignore-platform-reqs flag?", + initial: false, + }); + + this.ignorePlatformReqs = ignoreReqs; + } + return shouldInstall; } @@ -34,7 +47,9 @@ export default class ComposerInstall implements ActionInterface { phpAppDirectories.forEach((dir) => { debug(chalk.blue(`Running composer install in ${dir}...`)); - exec("composer install --no-interaction --no-progress", debug, { + const command = `composer install ${this.ignorePlatformReqs ? '--ignore-platform-reqs' : ''} --no-interaction --no-progress`; + + exec(command, debug, { cwd: dir, }); diff --git a/packages/local-refresh/src/actions/ResetDatabase.ts b/packages/local-refresh/src/actions/ResetDatabase.ts index 0c7dfca145..94d29864aa 100644 --- a/packages/local-refresh/src/actions/ResetDatabase.ts +++ b/packages/local-refresh/src/actions/ResetDatabase.ts @@ -172,6 +172,7 @@ export default class ResetDatabase implements ActionInterface { -e INSTALL_MYSQL=true \ -v "${this.etlDirectory}":/liquibase/changelog \ -w /liquibase/changelog \ + --add-host=host.docker.internal:host-gateway \ liquibase/liquibase \ --defaultsFile=${this.liquibasePropertiesFileName} \ update \