PHP is a server-side scripting language designed for web development, but which can also be used as a general-purpose programming language. PHP can be added to straight HTML or it can be used with a variety of templating engines and web frameworks. PHP code is usually processed by an interpreter, which is either implemented as a native module on the web-server or as a common gateway interface (CGI).
wikipedia.org/wiki/PHP
FROM ghcr.io/appjail-makejails/php:15.1-85
COPY . /myapp
WORKDIR /myapp
CMD ["php", "./your-script.php"]Then, run the commands to build and run the OCI image:
$ buildah build --network=host -t my-php-app .
$ appjail oci run \
-o overwrite=force \
-o ephemeral \
-o alias \
-o ip4_inherit \
localhost/my-php-app my-php-appFor many simple, single file projects, you may find it inconvenient to write a complete Containerfile. In such cases, you can run a PHP script by using the PHP OCI image directly:
$ appjail oci run \
-o overwrite=force \
-o ephemeral \
-o alias \
-o ip4_inherit \
-o fstab="$PWD /myapp" \
-w /myapp \
ghcr.io/appjail-makejails/php:15.1-85 my-php-app \
php your-script.phpFor running this OCI image as an arbitrary user, -u flag to appjail oci run should be used (which can accept both a username/group in the container's /etc/passwd file like -u www or a specific UID/GID like -u 80:80).
php_from(default:ghcr.io/appjail-makejails/php): Location of OCI image. See also OCI Configuration.php_tag(default:latest): OCI image tag. See also OCI Configuration.
PHP_USE_FPM(optional): When set, php-fpm runs instead of the PHP CLI, with/usr/local/wwwas the working directory.
build:
variants:
- tag: 15.1-82
containerfile: Containerfile
args:
FREEBSD_RELEASE: "15.1"
PHPVER: "82"
- tag: 15.1-83
containerfile: Containerfile
args:
FREEBSD_RELEASE: "15.1"
PHPVER: "83"
- tag: 15.1-84
containerfile: Containerfile
args:
FREEBSD_RELEASE: "15.1"
PHPVER: "84"
- tag: 15.1-85
containerfile: Containerfile
args:
FREEBSD_RELEASE: "15.1"
PHPVER: "85"- This image installs
php.ini-productionasphp.ini. You can always override or customize these settings.
