diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 54a81fd..74f19d8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -9,6 +9,7 @@ on: env: OLS_VERSION: 1.7.19 PHP_STABLE_VERSION: '8.3.2' + NODE_STABLE_VERSION: '20' REGISTRY: ghcr.io jobs: @@ -22,6 +23,10 @@ jobs: - '8.1.27' - '8.2.15' - '8.3.2' + NODE_VERSION: + - '16' + - '18' + - '20' steps: - name: Checkout @@ -63,7 +68,9 @@ jobs: # https://github.com/marketplace/actions/build-and-push-docker-images - name: Build and Push Docker Image uses: docker/build-push-action@v5 - if: matrix.PHP_VERSION != env.PHP_STABLE_VERSION + if: | + matrix.PHP_VERSION != env.PHP_STABLE_VERSION + && matrix.NODE_VERSION != env.NODE_STABLE_VERSION with: context: template platforms: linux/arm64 @@ -73,20 +80,79 @@ jobs: PHP_VERSION=${{ matrix.PHP_VERSION }} PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }} PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }} + NODE_VERSION=${{ matrix.NODE_VERSION }} push: true tags: | + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}.${{ steps.ols-version.outputs._1 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + no-cache: ${{ github.event_name == 'workflow_dispatch' && true || false }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/ndigitals/openlitespeed + cache-to: type=inline + + # https://github.com/marketplace/actions/build-and-push-docker-images + - name: Build and Push Docker Image - latest PHP, non-latest Node + uses: docker/build-push-action@v5 + if: | + matrix.PHP_VERSION == env.PHP_STABLE_VERSION + && matrix.NODE_VERSION != env.NODE_STABLE_VERSION + with: + context: template + platforms: linux/arm64 + provenance: false + build-args: | + OLS_VERSION=${{ env.OLS_VERSION }} + PHP_VERSION=${{ matrix.PHP_VERSION }} + PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }} + PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }} + NODE_VERSION=${{ matrix.NODE_VERSION }} + push: true + tags: | + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}.${{ steps.ols-version.outputs._1 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} + no-cache: ${{ github.event_name == 'workflow_dispatch' && true || false }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/ndigitals/openlitespeed + cache-to: type=inline + + # https://github.com/marketplace/actions/build-and-push-docker-images + - name: Build and Push Docker Image - latest Node, non-latest PHP + uses: docker/build-push-action@v5 + if: | + matrix.PHP_VERSION != env.PHP_STABLE_VERSION + && matrix.NODE_VERSION == env.NODE_STABLE_VERSION + with: + context: template + platforms: linux/arm64 + provenance: false + build-args: | + OLS_VERSION=${{ env.OLS_VERSION }} + PHP_VERSION=${{ matrix.PHP_VERSION }} + PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }} + PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }} + NODE_VERSION=${{ matrix.NODE_VERSION }} + push: true + tags: | + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}.${{ steps.ols-version.outputs._1 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }-node${{ matrix.NODE_VERSION }}} ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}.${{ steps.ols-version.outputs._1 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} ${{ env.REGISTRY }}/ndigitals/openlitespeed:lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} no-cache: ${{ github.event_name == 'workflow_dispatch' && true || false }} cache-from: type=registry,ref=${{ env.REGISTRY }}/ndigitals/openlitespeed cache-to: type=inline # https://github.com/marketplace/actions/build-and-push-docker-images - - name: Build and Push Docker Image - latest + - name: Build and Push Docker Image - latest PHP & Node uses: docker/build-push-action@v5 - if: matrix.PHP_VERSION == env.PHP_STABLE_VERSION + if: | + matrix.PHP_VERSION == env.PHP_STABLE_VERSION + && matrix.NODE_VERSION == env.NODE_STABLE_VERSION with: context: template platforms: linux/arm64 @@ -96,11 +162,16 @@ jobs: PHP_VERSION=${{ matrix.PHP_VERSION }} PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }} PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }} + NODE_VERSION=${{ matrix.NODE_VERSION }} push: true tags: | + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}.${{ steps.ols-version.outputs._1 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}.${{ steps.ols-version.outputs._1 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ steps.ols-version.outputs._0 }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} + ${{ env.REGISTRY }}/ndigitals/openlitespeed:lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }-node${{ matrix.NODE_VERSION }}} ${{ env.REGISTRY }}/ndigitals/openlitespeed:lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} ${{ env.REGISTRY }}/ndigitals/openlitespeed:latest no-cache: ${{ github.event_name == 'workflow_dispatch' && true || false }} diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 4524b8d..9ea0e0e 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -9,6 +9,7 @@ on: env: OLS_VERSION: 1.7.19 PHP_STABLE_VERSION: '8.3.2' + NODE_STABLE_VERSION: '20' REGISTRY: ghcr.io jobs: @@ -22,6 +23,10 @@ jobs: - '8.1.27' - '8.2.15' - '8.3.2' + NODE_VERSION: + - '16' + - '18' + - '20' steps: - name: Checkout @@ -63,9 +68,10 @@ jobs: PHP_VERSION=${{ matrix.PHP_VERSION }} PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }} PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }} + NODE_VERSION=${{ matrix.NODE_VERSION }} load: true push: false - tags: openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }} + tags: openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }} no-cache: ${{ github.event_name == 'workflow_dispatch' && true || false }} cache-from: type=registry,ref=${{ env.REGISTRY }}/ndigitals/openlitespeed cache-to: type=inline diff --git a/README.md b/README.md index 73e1d8a..c5c3359 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,18 @@ Install a lightweight OpenLiteSpeed container using the Stable version in Debian ## Supported tags -- `1.7.19-lsphp83`, `1.7-lsphp83`, `1-lsphp83`, `lsphp83` -- `1.7.19-lsphp82`, `1.7-lsphp82`, `1-lsphp82`, `lsphp82` -- `1.7.19-lsphp81`, `1.7-lsphp81`, `1-lsphp81`, `lsphp81` -- `1.7.19-lsphp80`, `1.7-lsphp80`, `1-lsphp80`, `lsphp80` +- `1.7.19-lsphp83-node20`, `1.7.19-lsphp83`, `1.7-lsphp83-node20`, `1.7-lsphp83`, `1-lsphp83-node20`, `1-lsphp83`, `lsphp83-node20`, `lsphp83` +- `1.7.19-lsphp83-node18`, `1.7-lsphp83-node18`, `1-lsphp83-node18`, `lsphp83-node18` +- `1.7.19-lsphp83-node16`, `1.7-lsphp83-node16`, `1-lsphp83-node16`, `lsphp83-node16` +- `1.7.19-lsphp82-node20`, `1.7.19-lsphp82`, `1.7-lsphp82-node20`, `1.7-lsphp82`, `1-lsphp82-node20`, `1-lsphp82`, `lsphp82-node20`, `lsphp82` +- `1.7.19-lsphp82-node18`, `1.7-lsphp82-node18`, `1-lsphp82-node18`, `lsphp82-node18` +- `1.7.19-lsphp82-node16`, `1.7-lsphp82-node16`, `1-lsphp82-node16`, `lsphp82-node16` +- `1.7.19-lsphp81-node20`, `1.7.19-lsphp81`, `1.7-lsphp81-node20`, `1.7-lsphp81`, `1-lsphp81-node20`, `1-lsphp81`, `lsphp81-node20`, `lsphp81` +- `1.7.19-lsphp81-node18`, `1.7-lsphp81-node18`, `1-lsphp81-node18`, `lsphp81-node18` +- `1.7.19-lsphp81-node16`, `1.7-lsphp81-node16`, `1-lsphp81-node16`, `lsphp81-node16` +- `1.7.19-lsphp80-node20`, `1.7.19-lsphp80`, `1.7-lsphp80-node20`, `1.7-lsphp80`, `1-lsphp80-node20`, `1-lsphp80`, `lsphp80-node20`, `lsphp80` +- `1.7.19-lsphp80-node18`, `1.7-lsphp80-node18`, `1-lsphp80-node18`, `lsphp80-node18` +- `1.7.19-lsphp80-node16`, `1.7-lsphp80-node16`, `1-lsphp80-node16`, `lsphp80-node16` - `1.7.18-lsphp83`, `1.7.18-lsphp82`, `1.7.18-lsphp81`, `1.7.18-lsphp80` - `1.7.17-lsphp82`, `1.7.17-lsphp81`, `1.7.17-lsphp80` - `1.7.16-lsphp82`, `1.7.16-lsphp81`, `1.7.16-lsphp80` @@ -80,6 +88,12 @@ Feel free to substitute the "openlitespeed" to the "Container_ID" if you did not docker stop openlitespeed ``` +## NodeJS Support + +This image includes NodeJS in order to run NodeJS apps. Choose a tag that includes the version of NodeJS needed. + +See official documentation for more details on running NodeJS under OpenLiteSpeed. https://openlitespeed.org/kb/running-node-js-apps-with-openlitespeed/ + ## Support & Feedback If you still have a question after using OpenLiteSpeed Docker, you have a few options. diff --git a/template/Dockerfile b/template/Dockerfile index d9c3688..ea6e4ae 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -2,6 +2,7 @@ ARG OLS_VERSION ARG PHP_VERSION ARG PHP_MAJOR_VERSION ARG PHP_MINOR_VERSION +ARG NODE_VERSION FROM wordpress:cli-php${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION} AS wp-cli @@ -9,6 +10,7 @@ ARG OLS_VERSION ARG PHP_VERSION ARG PHP_MAJOR_VERSION ARG PHP_MINOR_VERSION +ARG NODE_VERSION FROM litespeedtech/openlitespeed:${OLS_VERSION}-lsphp${PHP_MAJOR_VERSION}0 AS ols @@ -24,6 +26,7 @@ ARG OLS_VERSION ARG PHP_VERSION ARG PHP_MAJOR_VERSION ARG PHP_MINOR_VERSION +ARG NODE_VERSION ENV OLS_VERSION=${OLS_VERSION} ENV PHP_VERSION=${PHP_VERSION} @@ -32,6 +35,7 @@ ENV PHP_MINOR_VERSION=${PHP_MINOR_VERSION} ENV OLS_ADMIN_PHP_VERSION=7.4.33 ENV OLS_ADMIN_PHP_MAJOR_VERSION=7 ENV OLS_ADMIN_PHP_MINOR_VERSION=4 +ENV NODE_VERSION=${NODE_VERSION} COPY *.sh /build/ diff --git a/template/prepare-runtime.sh b/template/prepare-runtime.sh index 7ac1f6d..8cbd401 100755 --- a/template/prepare-runtime.sh +++ b/template/prepare-runtime.sh @@ -5,8 +5,8 @@ apt-get update -y apt-get install $MINIMAL_APT_GET_ARGS $SETUP_PACKAGES -# Prepare to install Node 16. -curl -sL https://deb.nodesource.com/setup_16.x | bash - +# Prepare to install Node. +curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - # Prepare to install Yarn. curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -