Sign inSign up

mvilche/php-s2i

By mvilche

•Updated about 5 years ago

Php Image s2i Openshift Ready!

Image
1

10K+

mvilche/php-s2i repository overview

⁠PHP S2I Images CentOS / Alpine

Docker Stars Docker Pulls Docker Automated Docker Build

⁠Features

  • Non-root
  • Okd Ready!
  • Kubernetes Ready!
  • S2i build images
  • Composer and npm
  • Artisan Migrations
  • Composer nexus private repository
  • Composer Version 1.10.16
  • Php-fpm + Apache Images
  • Php-fpm + Nginx Images
  • Apache + Mod_php Images
⁠Deploy Environments
EnvironmentDetails
TIMEZONESet Timezone (America/Montevideo, America/El_salvador)
WAITFOR_HOSTset name host
WAITFOR_PORTset port for WAITFOR_HOST
MIGRATIONSEnable artisan migrations. 1/0
ARTISAN_COMMAND_OVERRIDEOverride artisan command execute when migration is enabled
PHP_MEMORY_LIMITSet memory limit in PHP (Example: 512M) - Default value -1(no limit) - Only in fpm images
FPM_MAX_CHILDRENSet max concurrent clients fpm (Example: 250) - Default value 50 - Only in fpm images
⁠Apache images tuning
EnvironmentDetails
MAX_REQUEST_WORKERSet max concurrent clients in Apache (Example: 500) - Default value 250 - Only in fpm images
SERVER_LIMITSet number server limit in Apache (Example: 20) - Default value 16 - Only in fpm images
⁠Nginx images tuning
EnvironmentDetails
NGINX_WORKER_CONNECTIONSet max concurrent clients in Nginx (Example: 500) - Default value 1024 - Only in fpm images
NGINX_WORKER_PROCESSESSet number process in Nginx (Example: 20) - Default value 1 - Only in fpm images
⁠Build Environments
EnvironmentDetails
NEXUS_COMPOSER_REPOUrl private composer repository
EXTRA_COMPOSER_COMMANDRun extra composer command after install dependencies process
⁠How use in Openshift

oc process -f https://raw.githubusercontent.com/mvilche/php-s2i-openshift/master/php-s2i-template-openshift.yaml \ 
-p PHP_VERSION=php72 \
-p APP_NAME=miapp \ 
-p APP_REPO=https://github.com/myuser/php-composer-sample-app.git | oc create -f -

⁠Use configmap for database connection using composer env file

apiVersion: v1
data:
  env: |-
    APP_NAME=Lumen
    APP_ENV=local
    APP_KEY=
    APP_DEBUG=true
    APP_URL=http://miapp
    APP_TIMEZONE=America/Montevideo
    LOG_CHANNEL=stack
    LOG_SLACK_WEBHOOK_URL=
    DB_CONNECTION=mysql
    DB_HOST=mysql
    DB_PORT=3306
    DB_DATABASE=database_name
    DB_USERNAME=user
    DB_PASSWORD=pass
    CACHE_DRIVER=file
    QUEUE_CONNECTION=sync
kind: ConfigMap
metadata:
  name: composer-env

⁠Generate builder image

 docker build -t s2i-php:71 -f php71/Dockerfile.centos8 php71

⁠Php application image use s2i

s2i build https://github.com/my_phpapp.git s2i-php:71 myphp_app:latest --incremental

⁠Run application

docker run -p 8080:8080 myphp_app:latest

⁠How use s2i

https://github.com/openshift/source-to-image

⁠How use without s2i

docker run --name my_php -p 8080:8080 -d -v ./source:/var/www/html mvilche/php-s2i:73-alpine 

⁠License

Martin vilche

Tag summary

Content type

Image

Digest

Size

339.8 MB

Last updated

about 5 years ago

docker pull mvilche/php-s2i:80-centos