From 0f7e8421f82a5a0c314f9fb42e900ef81ef1efef Mon Sep 17 00:00:00 2001 From: Marco Polichetti Date: Thu, 14 Sep 2023 23:17:14 +0200 Subject: [PATCH] =?UTF-8?q?feat(release)!:=20Use=20the=20new=20nodesource?= =?UTF-8?q?=20repository=20instead=20of=20the=20old=20installation=20scrip?= =?UTF-8?q?t=20=F0=9F=A7=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 7 +++++-- UPGRADE.md | 7 +++++++ docker-compose.override.yml | 4 ++-- docker-compose.yml | 2 +- docker/php/Dockerfile | 3 +++ docs/configuration.md | 8 ++++---- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7df142f..eb99950 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ARG COMPOSER_VERSION=lts #ejs <% if (production) { _%> ARG KNOWN_HOSTS="bitbucket.org github.com gitlab.com" #ejs <% } _%> -ARG NODE_VERSION=lts +ARG NODE_VERSION=18 #ejs <% if (mariadb) { _%> ARG MARIADB_VERSION=11 #ejs <% } _%> @@ -154,7 +154,10 @@ RUN \ install-php-extensions $EXTENSIONS; \ fi; \ # Install Node.js, update npm and install Yarm - curl -fsSL https://deb.nodesource.com/setup_"$NODE_VERSION".x | bash -; \ + mkdir -p /etc/apt/keyrings; \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \ + apt-get update; \ apt-get install -y --no-install-recommends nodejs; \ npm update -g npm; \ npm install -g yarn; \ diff --git a/UPGRADE.md b/UPGRADE.md index 8dc66bc..f7fbba7 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,12 @@ # Upgrade +## `0.2.x` to `0.3.0` + +The PHP development image now uses the [new installation method for node](https://github.com/nodesource/distributions). Long story short, `lts` and `current` keywords can't be used anymore in `NODE_VERSION` variable. + +- Pull the updated PHP development image +- Carefully merge changes in `Dockerfile`, `docker-compose.yml`, `docker-compose.override.yml` + ## `0.2.x` to `0.2.4` - In your `docker-compose.dev.yml` ensure `caddy.volumes` contains `public_bundles:/srv/public/bundles` diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 4e07fc7..221896f 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -7,7 +7,7 @@ services: PHP_VERSION: ${PHP_VERSION:-8} PHP_EXTENSIONS: ${PHP_EXTENSIONS:-} COMPOSER_VERSION: ${COMPOSER_VERSION:-lts} - NODE_VERSION: ${NODE_VERSION:-lts} + NODE_VERSION: ${NODE_VERSION:-18} environment: APP_ENV: prod ports: @@ -27,7 +27,7 @@ services: build: target: php-prod args: - NODE_VERSION: ${NODE_VERSION:-lts} + NODE_VERSION: ${NODE_VERSION:-18} environment: APP_ENV: prod volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 11699d6..bb99a04 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,7 @@ services: PHP_VERSION: ${PHP_VERSION:-8} PHP_EXTENSIONS: ${PHP_EXTENSIONS:-} COMPOSER_VERSION: ${COMPOSER_VERSION:-lts} - NODE_VERSION: ${NODE_VERSION:-lts} + NODE_VERSION: ${NODE_VERSION:-18} #ejs <%_ if (!mariadb) { _%> environment: DATABASE_ENABLE_MIGRATIONS: false diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index 9890a8a..5a52573 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -83,6 +83,9 @@ ARG EXTENSIONS_DEV COPY --link php.dev.ini /usr/local/etc/php/conf.d/symfony-sail.dev.ini RUN \ + # Install OS packages + apt-get update; \ + apt-get install -y --no-install-recommends gnupg; \ # Copy base configuration file cp "$PHP_INI_DIR"/php.ini-development "$PHP_INI_DIR"/php.ini; \ # Install PHP extensions diff --git a/docs/configuration.md b/docs/configuration.md index 86ae9dc..9f427e7 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -120,7 +120,7 @@ Summary of variables, where they should be defined, and their default values: NODE_VERSION ✅ ❌ - lts + 18 @@ -231,9 +231,9 @@ Further considerations: ### Node-related variables -| Variable | Allowed values | Notes | -| :------------- | :-------------------- | :---- | -| `NODE_VERSION` | "current", "lts", `x` | | +| Variable | Allowed values | Notes | +| :------------- | :------------- | :---- | +| `NODE_VERSION` | `x` | | ### Database-related variables