forked from litespeedtech/ols-dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(debian): Changes to Debian 12 to Correlate with Latest Official …
…OLS Ubuntu 22.04 Build * Fixes #102 * Updates the Docker base image to use Debian 12. * Updates build library requirements. * Downgrades OpenSSL v3 to v1.1.1. * Adds pull request Docker image build testing. * Updates to build the OLS admin PHP version to match the system/hosting PHP version.
- Loading branch information
Showing
6 changed files
with
120 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: docker-build | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
env: | ||
OLS_VERSION: 1.7.17 | ||
PHP_STABLE_VERSION: '8.2.8' | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
buildx: | ||
runs-on: self-hosted | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
PHP_VERSION: ['8.0.29', '8.1.21', '8.2.8'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags | ||
|
||
# https://github.com/marketplace/actions/docker-setup-buildx | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# https://github.com/marketplace/actions/docker-login | ||
- name: Login to GitHub Packages | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
logout: false | ||
|
||
# https://github.com/orgs/community/discussions/26625#discussioncomment-3252582 | ||
- name: Determine PHP Major/Minor Version | ||
id: php-version | ||
run: | | ||
_0=$(echo ${{ matrix.PHP_VERSION }} | cut -d. -f1) | ||
_1=$(echo ${{ matrix.PHP_VERSION }} | cut -d. -f2) | ||
echo "_0=$_0" >> $GITHUB_OUTPUT | ||
echo "_1=$_1" >> $GITHUB_OUTPUT | ||
# https://github.com/marketplace/actions/build-and-push-docker-images | ||
- name: Build Docker Images | ||
uses: docker/build-push-action@v4 | ||
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 }} | ||
push: false | ||
tags: ${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-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:latest | ||
cache-to: type=inline | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,81 @@ | ||
# OpenLiteSpeed Docker Container | ||
|
||
[![Build Status](https://github.com/ndigitals/ols-dockerfiles/workflows/docker-build/badge.svg)](https://github.com/ndigitals/ols-dockerfiles/actions/new) | ||
|
||
Install a lightweight OpenLiteSpeed container using the Stable version in Debian 11 Linux on arm64. | ||
|
||
### Prerequisites | ||
* [Install Docker](https://www.docker.com/) | ||
|
||
- [Install Docker](https://www.docker.com/) | ||
|
||
## Build Components | ||
|
||
The system will regulary build the OpenLiteSpeed Latest stable version, along with at least two PHP versions, currently only PHP 8.x. | ||
|
||
|Component|Version| | ||
| :-------------: | :-------------: | | ||
|Linux|Debian 11| | ||
|OpenLiteSpeed|[Latest stable version](https://openlitespeed.org/release-log/version-1-7-x)| | ||
|PHP|[Latest stable version](https://www.php.net/downloads)| | ||
| Component | Version | | ||
| :-----------: | :--------------------------------------------------------------------------: | | ||
| Linux | Debian 12(slim) | | ||
| OpenLiteSpeed | [Latest stable version](https://openlitespeed.org/release-log/version-1-7-x) | | ||
| PHP | [Latest stable versions](https://www.php.net/downloads) | | ||
|
||
## Usage | ||
|
||
### Download an image | ||
|
||
Download the openlitespeed image, we can use latest for latest version | ||
|
||
``` | ||
docker pull ghcr.io/ndigitals/openlitespeed:latest | ||
``` | ||
|
||
or specify the OpenLiteSpeed version with lsphp version | ||
|
||
``` | ||
docker pull ghcr.io/ndigitals/openlitespeed:1.7.16-lsphp80 | ||
docker pull ghcr.io/ndigitals/openlitespeed:1.7.17-lsphp80 | ||
``` | ||
|
||
### Start a Container | ||
|
||
``` | ||
docker run --name openlitespeed -p 7080:7080 -p 80:80 -p 443:443 -it ghcr.io/ndigitals/openlitespeed:latest | ||
``` | ||
|
||
You can also run with Detached mode, like so: | ||
|
||
``` | ||
docker run -d --name openlitespeed -p 7080:7080 -p 80:80 -p 443:443 -it ghcr.io/ndigitals/openlitespeed:latest | ||
``` | ||
Tip, you can get rid of `-p 7080:7080` from the command if you don’t need the web admin access. | ||
|
||
Tip, you can get rid of `-p 7080:7080` from the command if you don’t need the web admin access. | ||
|
||
### Add a sample page | ||
|
||
The server should start running successfully, and you should be able to log into the container. Add some files you want to display with the following command: | ||
|
||
``` | ||
docker exec -it openlitespeed bash | ||
``` | ||
Your default `WORKDIR` should be `/var/www/vhosts/`, since the default document root path is `/var/www/vhosts/localhost/html`. Simply add the following command to `index.php`, then we can verify it from the browser with a public server IP address on both HTTP and HTTPS. | ||
|
||
Your default `WORKDIR` should be `/var/www/vhosts/`, since the default document root path is `/var/www/vhosts/localhost/html`. Simply add the following command to `index.php`, then we can verify it from the browser with a public server IP address on both HTTP and HTTPS. | ||
|
||
``` | ||
echo '<?php phpinfo();' > localhost/html/index.php | ||
``` | ||
|
||
### Stop a Container | ||
|
||
Feel free to substitute the "openlitespeed" to the "Container_ID" if you did not define any name for the container. | ||
|
||
``` | ||
docker stop openlitespeed | ||
``` | ||
|
||
## Support & Feedback | ||
|
||
If you still have a question after using OpenLiteSpeed Docker, you have a few options. | ||
* Join [the GoLiteSpeed Slack community](https://litespeedtech.com/slack) for real-time discussion | ||
* Post to [the OpenLiteSpeed Forums](https://forum.openlitespeed.org/) for community support | ||
* Reporting any issue on [Github ols-dockerfiles](https://github.com/ndigitals/ols-dockerfiles/issues) project | ||
|
||
**Pull requests are always welcome** | ||
- Join [the GoLiteSpeed Slack community](https://litespeedtech.com/slack) for real-time discussion | ||
- Post to [the OpenLiteSpeed Forums](https://forum.openlitespeed.org/) for community support | ||
- Reporting any issue on [Github ols-dockerfiles](https://github.com/ndigitals/ols-dockerfiles/issues) project | ||
|
||
**Pull requests are always welcome** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters