Skip to content

Commit

Permalink
Merge pull request #147 from ndigitals/develop
Browse files Browse the repository at this point in the history
2024-01-20 Feature & Fix Release
  • Loading branch information
timnolte authored Jan 21, 2024
2 parents e0379d3 + 22a490e commit edb47d3
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 13 deletions.
77 changes: 74 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -22,6 +23,10 @@ jobs:
- '8.1.27'
- '8.2.15'
- '8.3.2'
NODE_VERSION:
- '16'
- '18'
- '20'

steps:
- name: Checkout
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -22,6 +23,10 @@ jobs:
- '8.1.27'
- '8.2.15'
- '8.3.2'
NODE_VERSION:
- '16'
- '18'
- '20'

steps:
- name: Checkout
Expand Down Expand Up @@ -63,16 +68,17 @@ 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

- name: Test Docker Image
run: |
IMAGE=openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}
IMAGE=openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }}
ID=$(docker run -d ${IMAGE})
sleep 5s
docker exec -i ${ID} su -c 'mkdir -p /var/www/vhosts/localhost/html/ && echo "<?php phpinfo();" > /var/www/vhosts/localhost/html/index.php && service lsws restart'
Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ Install a lightweight OpenLiteSpeed container using the Stable version in Debian

## Supported tags

- `1.7.18-lsphp83`, `1.7-lsphp83`, `1-lsphp83`, `lsphp83`
- `1.7.18-lsphp82`, `1.7-lsphp82`, `1-lsphp82`, `lsphp82`
- `1.7.18-lsphp81`, `1.7-lsphp81`, `1-lsphp81`, `lsphp81`
- `1.7.18-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`

Expand Down Expand Up @@ -79,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.
Expand Down
6 changes: 5 additions & 1 deletion template/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ 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

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

Expand All @@ -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}
Expand All @@ -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/

Expand All @@ -57,7 +61,7 @@ RUN /build/secure-base.sh && \
RUN mkdir -p /usr/local/lsws/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/etc/php/${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}/

COPY --from=ols ["/usr/local/lsws/lsphp${PHP_MAJOR_VERSION}0/etc/php/${PHP_MAJOR_VERSION}.0/", "/usr/local/lsws/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/etc/php/${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}/"]
COPY --from=wp-cli ["/usr/local/bin/wp", "/usr/local/bin/wp"]
COPY --from=wp-cli ["/usr/local/bin/wp", "/usr/bin/wp"]

EXPOSE 7080
ENV PATH="/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin"
Expand Down
2 changes: 1 addition & 1 deletion template/config-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cd /build || exit

ln -sf $LSWS_HOME/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/bin/php${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION} /usr/bin/php
ln -sf $LSWS_HOME/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/bin/php${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION} $LSWS_HOME/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/bin/php
ln -sf $LSWS_HOME/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/bin/lsphp${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION} /usr/local/bin/lsphp
ln -sf $LSWS_HOME/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/bin/lsphp${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION} /usr/bin/lsphp
ln -sf $LSWS_HOME/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/bin/lsphp${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION} $LSWS_HOME/lsphp${PHP_MAJOR_VERSION}${PHP_MINOR_VERSION}/bin/lsphp

# Install missing PECL PHP modules.
Expand Down
4 changes: 2 additions & 2 deletions template/prepare-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down

0 comments on commit edb47d3

Please sign in to comment.