Skip to content

AppJail-makejails/php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

107 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php

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

php logo

How to use this Makejail

Create a Containerfile in your PHP project

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-app

Run a single PHP script

For 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.php

Running as an arbitrary user

For 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).

Arguments (stage: build)

  • 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.

Environment (stage: build)

  • PHP_USE_FPM (optional): When set, php-fpm runs instead of the PHP CLI, with /usr/local/www as the working directory.

OCI Configuration

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"

Notes

  1. This image installs php.ini-production as php.ini. You can always override or customize these settings.

About

PHP Scripting Language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors