diff --git a/README.md b/README.md index 2472a3c..e10331d 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,8 @@ Creates a new PHP development environment and mounts your project files. > #### Option: --node > -> Set which version of Node to install in your container. Is ignored if the `--disable-node` flag is -> passed, or if Node is disabled in your projects `spinner.yaml` file. Equivalent to setting -> `options.environment.node.version: x` in your projects Spinner config. +> Set which version of Node to install in your container. Equivalent to setting `options.environment.node.version: x` +> in your projects Spinner config. > #### Option: --database > @@ -59,11 +58,6 @@ Creates a new PHP development environment and mounts your project files. > Does not install a database with your environment. Equivalent to setting `options.environment.database.enabled: false` > in your Spinner config. -> #### Option: --disable-node -> -> Disables Node for your environment, so it isn't included in your PHP container. Equivalent to setting -> `options.environment.node.enabled: false` in your Spinner config. - > #### Option: --disable-server > > Does not install a webserver (so no Nginx). Useful if you just need a PHP container to run unit tests or something. diff --git a/config/php-fpm/Dockerfile b/config/php-fpm/Dockerfile index ee1bb8f..d315194 100644 --- a/config/php-fpm/Dockerfile +++ b/config/php-fpm/Dockerfile @@ -22,4 +22,13 @@ COPY ./opcache.ini "${PHP_INI_DIR}/conf.d" COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer -WORKDIR /var/www/html \ No newline at end of file +WORKDIR /var/www/html + +ENV NVM_DIR /root/.nvm + +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash \ + && . "$NVM_DIR/nvm.sh" \ + && nvm install ${NODE_VERSION} \ + && nvm use ${NODE_VERSION} + +COPY --from=node:${NODE_VERSION} /usr/local/bin/npx /usr/local/bin/npx \ No newline at end of file diff --git a/config/php-fpm/Node.Dockerfile b/config/php-fpm/Node.Dockerfile deleted file mode 100644 index 6c63e67..0000000 --- a/config/php-fpm/Node.Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -ENV NVM_DIR /root/.nvm - -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash \ - && . "$NVM_DIR/nvm.sh" \ - && nvm install ${NODE_VERSION} \ - && nvm use ${NODE_VERSION} - -COPY --from=node:${NODE_VERSION} /usr/local/bin/npx /usr/local/bin/npx \ No newline at end of file diff --git a/config/spinner.yaml b/config/spinner.yaml index b0deb86..1be09f7 100644 --- a/config/spinner.yaml +++ b/config/spinner.yaml @@ -4,7 +4,6 @@ options: version: 8.4 xdebug: true node: - enabled: true version: 23 server: enabled: true diff --git a/src/Classes/Config/Config.php b/src/Classes/Config/Config.php index 6b39f00..0055ece 100644 --- a/src/Classes/Config/Config.php +++ b/src/Classes/Config/Config.php @@ -58,18 +58,6 @@ class Config return (float) $this->getEnvironmentOption('php', 'version'); } - /** - * @throws \Exception - */ - public function isNodeEnabled(InputInterface $input): bool - { - if ($input->getOption('disable-node')) { - return false; - } - - return $this->getEnvironmentOption('node', 'enabled'); - } - /** * @throws \Exception */ diff --git a/src/Classes/File/PHPDockerFileBuilder.php b/src/Classes/File/PHPDockerFileBuilder.php index 4929781..8fa5b00 100644 --- a/src/Classes/File/PHPDockerFileBuilder.php +++ b/src/Classes/File/PHPDockerFileBuilder.php @@ -36,11 +36,7 @@ class PHPDockerFileBuilder extends AbstractFileBuilder $this->content .= $this->config->getConfigFileContents('php-fpm/Sqlite.Dockerfile'); } - if ($this->config->isNodeEnabled($input)) { - $this->addNewLine(); - $this->content .= $this->config->getConfigFileContents('php-fpm/Node.Dockerfile'); - $this->content = str_replace('${NODE_VERSION}', (string) $this->config->getNodeVersion($input), $this->content); - } + $this->content = str_replace('${NODE_VERSION}', (string) $this->config->getNodeVersion($input), $this->content); if ($this->config->isXdebugEnabled($input)) { $this->addNewLine(); diff --git a/src/Command/SpinCommand.php b/src/Command/SpinCommand.php index 92f356a..b60a89c 100644 --- a/src/Command/SpinCommand.php +++ b/src/Command/SpinCommand.php @@ -48,12 +48,6 @@ class SpinCommand extends AbstractSpinnerCommand InputOption::VALUE_OPTIONAL, 'The PHP version to use (e.g., 8.0).' ) - ->addOption( - 'disable-node', - null, - InputOption::VALUE_NONE, - 'Set this flag to disable Node.js for your environment.' - ) ->addOption( 'disable-server', null,