Skip to content

Commit

Permalink
[5.x] Add Sulu CMS (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinsenter authored Mar 12, 2024
1 parent ec6aac2 commit 9c2c44d
Show file tree
Hide file tree
Showing 55 changed files with 309 additions and 106 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
build-args: |
BUILD_CACHE_KEY=${{ env.BUILD_CACHE_KEY }}
BUILD_CACHE_PATH=${{ env.BUILD_CACHE_PATH }}
BUILD_FROM_IMAGE=${{ env.BUILD_FROM_IMAGE }}
BUILD_CONTEXT=${{ env.BUILD_CONTEXT }}
BUILD_DATE=${{ env.BUILD_DATE }}
BUILD_DESC=${{ env.BUILD_DESC }}
Expand Down Expand Up @@ -139,6 +140,7 @@ jobs:
build-args: |
BUILD_CACHE_KEY=${{ env.BUILD_CACHE_KEY }}
BUILD_CACHE_PATH=${{ env.BUILD_CACHE_PATH }}
BUILD_FROM_IMAGE=${{ env.BUILD_FROM_IMAGE }}
BUILD_CONTEXT=${{ env.BUILD_CONTEXT }}
BUILD_DATE=${{ env.BUILD_DATE }}
BUILD_DESC=${{ env.BUILD_DESC }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/php-web-servers-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ jobs:
- "app-mautic"
- "app-phpixie"
- "app-statamic"
- "app-sulu"
- "app-yii"
php_version:
- "8.3"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [5.0.3] - 2024-03-12

Added Sulu containers, updated descriptions for DockerHub repositories.

## [5.0.2] - 2024-02-23

Tightened Apache directory permissions to deny access to dotfiles and system directories. This also fixes #59.
Expand Down
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ RUN phpaddmod imagick swoole xdebug
The default application directory is `/var/www/html` and can be customized via the `$APP_PATH` environment variable:

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v "$PWD":/app \
-e APP_PATH=/app \
shinsenter/php:8.3-fpm-nginx
Expand All @@ -190,7 +190,7 @@ This would change the web application directory to `/app`.
Moreover, the default document root (a relative path inside the application directory that contains your index.php file) can be customized by setting the `$DOCUMENT_ROOT` environment variable:

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v "$PWD":/app \
-e APP_PATH=/app \
-e DOCUMENT_ROOT=/public \
Expand All @@ -216,7 +216,7 @@ The available variables are:

For example, to run a container as user `myapp` with uid `5000`, you could do:
```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-e APP_USER=myapp \
-e APP_UID=5000 \
shinsenter/php:8.3-fpm-nginx
Expand Down Expand Up @@ -269,11 +269,12 @@ DockerHub: https://docker.shin.company/php
(To edit this welcome message, add your text to /etc/welcome.txt)

----------------------------------------
Container : shinsenter/php
Distro : Alpine Linux v3.19
Timezone : UTC (GMT+0000)
UID / GID : www-data:www-data (82:82)
Web Root : /var/www/html
Container : shinsenter/php
Distro : Alpine Linux v3.19
Timezone : UTC (GMT+0000)
UID / GID : www-data:www-data (82:82)
App Root : /var/www/html
Document Root : /var/www/html/public
----------------------------------------

PHP Docker Images (https://hub.docker.com/r/shinsenter/php)
Expand All @@ -286,11 +287,11 @@ but WITHOUT ANY WARRANTY. See the GNU GPL for more details.

To get support, please contact: SHIN (@shinsenter)

PHP 8.3.2 (cli) (built: Jan 27 2024 04:26:04) (NTS)
PHP 8.3.3 (fpm-fcgi) (built: Feb 16 2024 23:20:45)
Copyright (c) The PHP Group
Zend Engine v4.3.2, Copyright (c) Zend Technologies
with Zend OPcache v8.3.2, Copyright (c), by Zend Technologies
Composer version 2.6.6 2023-12-08 18:32:26
Zend Engine v4.3.3, Copyright (c) Zend Technologies
with Zend OPcache v8.3.3, Copyright (c), by Zend Technologies
Composer version 2.7.1 2024-02-09 15:26:28
```
#### Disable autorun scripts
Expand Down
16 changes: 15 additions & 1 deletion build/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ with-unit)
S6_VERSION="latest"
BUILD_DOCKERFILE=$BASE_DIR/src/php/with-unit.dockerfile
BUILD_SOURCE_IMAGE="https://codeload.github.com/nginx/unit/tar.gz/refs/tags/$unit_version"
BUILD_CACHE_KEY="unit@$unit_version"
BUILD_CACHE_KEY="unit@$(echo "$unit_version" | head -c17)"
PHP_VARIANT="zts$SUFFIX"
verlt "$PHP_VERSION" "7.4" && SKIP_BUILD=1
;;
Expand All @@ -138,12 +138,14 @@ with-f8p)
BUILD_SOURCE_IMAGE="dunglas/frankenphp:$(get_dockerhub_latest_tag "dunglas/frankenphp" 1 "latest-php$PHP_VERSION$SUFFIX")"
BUILD_DOCKERFILE=$BASE_DIR/src/php/with-f8p.dockerfile
BUILD_PLATFORM="linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8"
BUILD_CACHE_KEY="frankenphp@$(get_dockerhub_latest_sha "dunglas/frankenphp" 1 "latest-php$PHP_VERSION$SUFFIX" | head -c17)"
PHP_VARIANT="zts$SUFFIX"
verlt "$PHP_VERSION" "8.2" && SKIP_BUILD=1
;;
app-*)
# implement later
APP_NAME="${APP//app-/}"
BUILD_FROM_IMAGE="shinsenter/phpfpm-apache"
BUILD_NAME="shinsenter/$APP_NAME"
BUILD_DOCKERFILE=$BASE_DIR/src/webapps/$APP_NAME/$APP_NAME.dockerfile
PHP_VARIANT="$SUFFIX"
Expand All @@ -161,6 +163,7 @@ app-*)
crater)
# https://docs.craterapp.com/installation.html
LATEST_PHP="8.1"
BUILD_FROM_IMAGE="shinsenter/phpfpm-nginx"
verlt "$PHP_VERSION" "7.4" && SKIP_BUILD=1
;;
drupal)
Expand All @@ -169,6 +172,7 @@ app-*)
;;
flarum)
# https://docs.flarum.org/install/
BUILD_FROM_IMAGE="shinsenter/phpfpm-nginx"
verlt "$PHP_VERSION" "7.3" && SKIP_BUILD=1
;;
fuelphp)
Expand All @@ -183,6 +187,7 @@ app-*)
hyperf)
# https://hyperf.wiki/3.1/#/en/quick-start/install
BUILD_PLATFORM="linux/amd64,linux/arm/v7,linux/arm64/v8"
BUILD_FROM_IMAGE="shinsenter/phpfpm-nginx"
verlt "$PHP_VERSION" "7.2" && SKIP_BUILD=1
if verlte "8.3" "$PHP_VERSION"; then
BUILD_PLATFORM="linux/amd64,linux/arm64/v8"
Expand All @@ -194,10 +199,12 @@ app-*)
;;
laminas)
# https://docs.laminas.dev/tutorials/getting-started/skeleton-application/
BUILD_FROM_IMAGE="shinsenter/phpfpm-nginx"
verlt "$PHP_VERSION" "7.3" && SKIP_BUILD=1
;;
laravel)
# https://laravel.com/docs/master/installation
BUILD_FROM_IMAGE="shinsenter/phpfpm-nginx"
;;
mautic)
# https://docs.mautic.org/en/5.x/getting_started/how_to_install_mautic.html#installing-with-composer
Expand All @@ -209,6 +216,7 @@ app-*)
;;
phpmyadmin)
# https://docs.phpmyadmin.net/en/latest/setup.html
BUILD_FROM_IMAGE="shinsenter/phpfpm-nginx"
;;
slim)
# https://www.slimframework.com/docs/v4/start/installation.html
Expand All @@ -220,14 +228,20 @@ app-*)
symfony)
# https://symfony.com/doc/current/setup.html
;;
sulu)
# https://github.com/sulu/skeleton
;;
wordpress)
# https://wordpress.org/documentation/category/installation/
;;
yii)
# https://www.yiiframework.com/doc/guide/2.0/en/start-installation
;;
esac

BUILD_CACHE_KEY="$BUILD_FROM_IMAGE@$(get_dockerhub_latest_sha "$BUILD_FROM_IMAGE" 1 "php$PHP_VERSION$PHP_VARIANT" | head -c17)"
;;

*)
# default
BUILD_DOCKERFILE=$BASE_DIR/src/php/base-php.dockerfile
Expand Down
2 changes: 1 addition & 1 deletion src/php/base-php.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG BUILD_FROM_IMAGE=${BUILD_FROM_IMAGE:-php}
ARG PHP_VERSION=${PHP_VERSION:-8.3}
ARG PHP_VARIANT=${PHP_VARIANT:-fpm-alpine}

FROM php:${PHP_VERSION}-${PHP_VARIANT}
FROM ${BUILD_FROM_IMAGE}:${PHP_VERSION}-${PHP_VARIANT}

# set PHP variables
ARG PHP_VERSION=${PHP_VERSION:-8.3}
Expand Down
11 changes: 6 additions & 5 deletions src/php/common/rootfs/startup/99-greeting
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ if ! is-true $DISABLE_GREETING; then
$([ -f $WELCOME_TXT ] && cat $WELCOME_TXT | sed "s#%PATH%#$WELCOME_TXT#g")
----------------------------------------
Container : $NAME
Distro : $(source /etc/os-release && echo ${PRETTY_NAME:-Unknown})
Timezone : $(date +'%Z') (GMT$(date +'%z'))
UID / GID : $APP_USER:$APP_GROUP ($(id -u $APP_USER):$(id -g $APP_USER))
Web Root : $(app-root)
Container : $NAME
Distro : $(source /etc/os-release && echo ${PRETTY_NAME:-Unknown})
Timezone : $(date +'%Z') (GMT$(date +'%z'))
UID / GID : $APP_USER:$APP_GROUP ($(id -u $APP_USER):$(id -g $APP_USER))
App Root : $(app-path)
Document Root : $(app-root)
----------------------------------------
$([ -f $LICENSE_TXT ] && cat $LICENSE_TXT | sed "s#%EMAIL%#$EMAIL#g" | sed "s#%YEAR%#$YEAR#g")
Expand Down
1 change: 1 addition & 0 deletions src/php/with-apache.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# License: https://code.shin.company/php/blob/main/LICENSE
################################################################################

ARG BUILD_FROM_IMAGE=${BUILD_FROM_IMAGE:-php}
ARG PHP_VERSION=${PHP_VERSION:-8.3}
ARG PHP_VARIANT=${PHP_VARIANT:-fpm-alpine}

Expand Down
4 changes: 2 additions & 2 deletions src/php/with-apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These images also include the latest version of [Composer](https://getcomposer.o
## Usage

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
shinsenter/phpfpm-apache:latest
```
Expand Down Expand Up @@ -45,7 +45,7 @@ COPY my_site.key /etc/ssl/site/server.key
#### Using docker run

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
-v ./my_site.crt:/etc/ssl/site/server.crt \
-v ./my_site.key:/etc/ssl/site/server.key \
Expand Down
1 change: 1 addition & 0 deletions src/php/with-f8p.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# License: https://code.shin.company/php/blob/main/LICENSE
################################################################################

ARG BUILD_FROM_IMAGE=${BUILD_FROM_IMAGE:-php}
ARG PHP_VERSION=${PHP_VERSION:-8.3}
ARG PHP_VARIANT=${PHP_VARIANT:-zts}
ARG BUILD_SOURCE_IMAGE=${BUILD_SOURCE_IMAGE:-dunglas/frankenphp:latest-php${PHP_VERSION}}
Expand Down
4 changes: 2 additions & 2 deletions src/php/with-f8p.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These images also include the latest version of [Composer](https://getcomposer.o
## Usage

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
shinsenter/frankenphp:latest
```
Expand Down Expand Up @@ -45,7 +45,7 @@ COPY my_site.key /etc/ssl/site/server.key
#### Using docker run

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
-v ./my_site.crt:/etc/ssl/site/server.crt \
-v ./my_site.key:/etc/ssl/site/server.key \
Expand Down
1 change: 1 addition & 0 deletions src/php/with-nginx.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# License: https://code.shin.company/php/blob/main/LICENSE
################################################################################

ARG BUILD_FROM_IMAGE=${BUILD_FROM_IMAGE:-php}
ARG PHP_VERSION=${PHP_VERSION:-8.3}
ARG PHP_VARIANT=${PHP_VARIANT:-fpm-alpine}

Expand Down
4 changes: 2 additions & 2 deletions src/php/with-nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These images also include the latest version of [Composer](https://getcomposer.o
## Usage

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
shinsenter/phpfpm-nginx:latest
```
Expand Down Expand Up @@ -45,7 +45,7 @@ COPY my_site.key /etc/ssl/site/server.key
#### Using docker run

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
-v ./my_site.crt:/etc/ssl/site/server.crt \
-v ./my_site.key:/etc/ssl/site/server.key \
Expand Down
1 change: 1 addition & 0 deletions src/php/with-unit.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# License: https://code.shin.company/php/blob/main/LICENSE
################################################################################

ARG BUILD_FROM_IMAGE=${BUILD_FROM_IMAGE:-php}
ARG PHP_VERSION=${PHP_VERSION:-8.3}
ARG PHP_VARIANT=${PHP_VARIANT:-zts}

Expand Down
4 changes: 2 additions & 2 deletions src/php/with-unit.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These images also include the latest version of [Composer](https://getcomposer.o
## Usage

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
shinsenter/unit-php:latest
```
Expand Down Expand Up @@ -45,7 +45,7 @@ COPY my_site.key /etc/ssl/site/server.key
#### Using docker run

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
-v ./my_site.crt:/etc/ssl/site/server.crt \
-v ./my_site.key:/etc/ssl/site/server.key \
Expand Down
6 changes: 3 additions & 3 deletions src/webapps/cakephp4/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shinsenter/cakephp4

🌏 (PHP) CakePHP docker containers for both production and development.
🔋 (PHP / CakePHP) Production-ready container with automatic CakePHP installer.

> Docker Hub: https://hub.docker.com/r/shinsenter/cakephp4
Expand Down Expand Up @@ -31,7 +31,7 @@ mkdir myproject
When running the container, mount this empty directory as a volume. For example:

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
shinsenter/cakephp4:latest
```
Expand Down Expand Up @@ -69,7 +69,7 @@ COPY my_site.key /etc/ssl/site/server.key
#### Using docker run

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
-v ./my_site.crt:/etc/ssl/site/server.crt \
-v ./my_site.key:/etc/ssl/site/server.key \
Expand Down
3 changes: 2 additions & 1 deletion src/webapps/cakephp4/cakephp4.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
# License: https://code.shin.company/php/blob/main/LICENSE
################################################################################

ARG BUILD_FROM_IMAGE=${BUILD_FROM_IMAGE:-shinsenter/phpfpm-apache}
ARG PHP_VERSION=${PHP_VERSION:-8.3}
ARG PHP_VARIANT=${PHP_VARIANT:-}

FROM shinsenter/phpfpm-apache:php${PHP_VERSION}${PHP_VARIANT}
FROM ${BUILD_FROM_IMAGE}:php${PHP_VERSION}${PHP_VARIANT}

################################################################################

Expand Down
6 changes: 3 additions & 3 deletions src/webapps/codeigniter4/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shinsenter/codeigniter4

🌏 (PHP) CodeIgniter docker containers for both production and development.
🔋 (PHP / CodeIgniter) Production-ready container with automatic CodeIgniter installer.

> Docker Hub: https://hub.docker.com/r/shinsenter/codeigniter4
Expand Down Expand Up @@ -31,7 +31,7 @@ mkdir myproject
When running the container, mount this empty directory as a volume. For example:

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
shinsenter/codeigniter4:latest
```
Expand Down Expand Up @@ -69,7 +69,7 @@ COPY my_site.key /etc/ssl/site/server.key
#### Using docker run

```shell
docker run --rm -p 80:80 -p 443:443 \
docker run --rm -p 80:80 -p 443:443 -p 443:443/udp \
-v ./myproject:/var/www/html \
-v ./my_site.crt:/etc/ssl/site/server.crt \
-v ./my_site.key:/etc/ssl/site/server.key \
Expand Down
3 changes: 2 additions & 1 deletion src/webapps/codeigniter4/codeigniter4.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
# License: https://code.shin.company/php/blob/main/LICENSE
################################################################################

ARG BUILD_FROM_IMAGE=${BUILD_FROM_IMAGE:-shinsenter/phpfpm-apache}
ARG PHP_VERSION=${PHP_VERSION:-8.3}
ARG PHP_VARIANT=${PHP_VARIANT:-}

FROM shinsenter/phpfpm-apache:php${PHP_VERSION}${PHP_VARIANT}
FROM ${BUILD_FROM_IMAGE}:php${PHP_VERSION}${PHP_VARIANT}

################################################################################

Expand Down
Loading

0 comments on commit 9c2c44d

Please sign in to comment.