├── .gitignore ├── .travis.yml ├── 5.4 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── apt │ │ └── sources.list │ │ ├── nginx │ │ ├── conf.d │ │ │ └── docker │ │ │ │ └── logs.conf │ │ └── sites-enabled │ │ │ └── default │ │ ├── php5 │ │ └── fpm │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── app-log.conf │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 5.6 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ └── docker │ │ │ │ └── logs.conf │ │ └── sites-enabled │ │ │ └── default │ │ ├── php5 │ │ └── fpm │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── app-log.conf │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 7.0 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ └── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ └── sites-enabled │ │ │ └── default │ │ ├── php │ │ └── 7.0 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── app-log.conf │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 7.1 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony3.conf │ │ │ └── symfony4.conf │ │ ├── php │ │ └── 7.1 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── app-log.conf │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 7.2-bullseye ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony3.conf │ │ │ └── symfony4.conf │ │ ├── php │ │ └── 7.2 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── app-log.conf │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 7.2-fpm-alpine ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony3.conf │ │ │ └── symfony4.conf │ │ ├── php7 │ │ ├── conf.d │ │ │ └── 99-symfony.ini │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ ├── supervisor.d │ │ ├── app-log.ini │ │ ├── nginx.ini │ │ └── php-fpm.ini │ │ └── supervisord.conf.save └── tests │ └── Dockerfile ├── 7.2 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony3.conf │ │ │ └── symfony4.conf │ │ ├── php │ │ └── 7.2 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── app-log.conf │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 7.3 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony3.conf │ │ │ └── symfony4.conf │ │ ├── php │ │ └── 7.3 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ ├── 99-cgi.ini │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 7.4-fpm-bullseye ├── Dockerfile └── rootfs │ ├── entrypoint.sh │ ├── etc │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony3.conf │ │ │ ├── symfony4.conf │ │ │ └── symfony5.conf │ └── supervisor │ │ └── conf.d │ │ ├── app-log.conf │ │ ├── nginx.conf │ │ └── php-fpm.conf │ └── usr │ └── local │ └── etc │ └── php │ ├── conf.d │ └── 99-symfony.ini │ └── pool.d │ └── www_kibatic.conf ├── 7.4 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony3.conf │ │ │ ├── symfony4.conf │ │ │ └── symfony5.conf │ │ ├── php │ │ └── 7.4 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ ├── 99-cgi.ini │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 8.0 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony4.conf │ │ │ └── symfony5.conf │ │ ├── php │ │ └── 8.0 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ ├── 99-cgi.ini │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 8.1 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony4.conf │ │ │ └── symfony5.conf │ │ ├── php │ │ └── 8.1 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ ├── 99-cgi.ini │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 8.2-fpm-alpine ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ ├── etc │ │ ├── nginx │ │ │ └── http.d │ │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ │ ├── logs.conf │ │ │ │ └── symfony.conf │ │ └── supervisor.d │ │ │ ├── app-log.ini │ │ │ ├── nginx.ini │ │ │ └── php-fpm.ini │ └── usr │ │ └── local │ │ └── etc │ │ └── php │ │ ├── conf.d │ │ └── 99-symfony.ini │ │ └── pool.d │ │ └── www_kibatic.conf └── tests │ └── Dockerfile ├── 8.2 ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ └── etc │ │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ ├── symfony4.conf │ │ │ └── symfony5.conf │ │ ├── php │ │ └── 8.2 │ │ │ └── fpm │ │ │ ├── conf.d │ │ │ ├── 99-cgi.ini │ │ │ └── 99-symfony.ini │ │ │ └── pool.d │ │ │ └── www_kibatic.conf │ │ └── supervisor │ │ └── conf.d │ │ ├── nginx.conf │ │ └── php-fpm.conf └── tests │ └── Dockerfile ├── 8.3-fpm-debian ├── Dockerfile ├── rootfs │ ├── entrypoint.sh │ ├── etc │ │ ├── nginx │ │ │ ├── conf.d │ │ │ │ ├── docker │ │ │ │ │ ├── gzip.conf │ │ │ │ │ └── logs.conf │ │ │ │ └── logs.conf │ │ │ └── sites-available │ │ │ │ └── default │ │ └── supervisor │ │ │ └── conf.d │ │ │ ├── app-log.conf │ │ │ ├── nginx.conf │ │ │ └── php-fpm.conf │ └── usr │ │ └── local │ │ └── etc │ │ └── php │ │ ├── conf.d │ │ └── 99-symfony.ini │ │ └── pool.d │ │ └── www_kibatic.conf └── tests │ └── Dockerfile ├── 8.4-fpm-debian ├── Dockerfile └── rootfs │ ├── enable-blackfire.sh │ ├── entrypoint.sh │ ├── etc │ ├── nginx │ │ ├── conf.d │ │ │ ├── docker │ │ │ │ ├── gzip.conf │ │ │ │ └── logs.conf │ │ │ └── logs.conf │ │ └── sites-available │ │ │ └── default │ └── supervisor │ │ └── conf.d │ │ ├── app-log.conf │ │ ├── nginx.conf │ │ └── php-fpm.conf │ └── usr │ └── local │ └── etc │ └── php │ ├── conf.d │ └── 99-symfony.ini │ └── pool.d │ └── www_kibatic.conf ├── README.md └── TROUBLESHOOTING.md /.gitignore: -------------------------------------------------------------------------------- 1 | */symfony 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: generic 3 | # Use the new container infrastructure 4 | sudo: required 5 | 6 | env: 7 | - PHP_VERSION=7.1 SYMFONY_VERSION=3 8 | - PHP_VERSION=7.1 SYMFONY_VERSION=4 9 | - PHP_VERSION=7.2 SYMFONY_VERSION=3 10 | - PHP_VERSION=7.2 SYMFONY_VERSION=4 11 | - PHP_VERSION=7.3 SYMFONY_VERSION=4 12 | - PHP_VERSION=7.4 SYMFONY_VERSION=5 13 | - PHP_VERSION=8.0 SYMFONY_VERSION=5 14 | - PHP_VERSION=8.1 SYMFONY_VERSION=5 15 | - PHP_VERSION=8.5 SYMFONY_VERSION=5 16 | 17 | services: 18 | - docker 19 | 20 | cache: 21 | directories: 22 | - $HOME/.composer 23 | 24 | install: 25 | - cd $PHP_VERSION 26 | - echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_USERNAME} --password-stdin 27 | # Build image 28 | - sudo docker build . -t kibatic/symfony:$PHP_VERSION 29 | # Check installed php version 30 | - sudo docker run -it kibatic/symfony:$PHP_VERSION php --version | grep "PHP $PHP_VERSION" 31 | - sudo docker build -f tests/Dockerfile . -t kibatic/symfony-demo:$PHP_VERSION 32 | - export SYMFONY_DEMO_VERSION="v1.0.5" 33 | - if [ "$SYMFONY_VERSION" = "4" ]; then export SYMFONY_DEMO_VERSION="v1.4.4"; fi 34 | - if [ "$SYMFONY_VERSION" = "5" ]; then export SYMFONY_DEMO_VERSION="v1.6.4"; fi 35 | - if [ "$SYMFONY_VERSION" = "5" -a "$PHP_VERSION" = "8.0" ]; then export SYMFONY_DEMO_VERSION="main"; fi 36 | - if [ "$SYMFONY_VERSION" = "5" -a "$PHP_VERSION" = "8.1" ]; then export SYMFONY_DEMO_VERSION="main"; fi 37 | - if [ "$SYMFONY_VERSION" = "5" -a "$PHP_VERSION" = "8.2" ]; then export SYMFONY_DEMO_VERSION="main"; fi 38 | 39 | script: 40 | - git clone https://github.com/symfony/symfony-demo symfony; cd symfony; git checkout $SYMFONY_DEMO_VERSION 41 | - sudo docker run --rm -v $(pwd):/var/www -v $HOME/.composer:/root/.composer kibatic/symfony-demo:$PHP_VERSION composer install --no-progress || true 42 | - sudo docker run --rm --name symfony -d -p 8001:80 -e SYMFONY_VERSION=$SYMFONY_VERSION -v $(pwd):/var/www kibatic/symfony-demo:$PHP_VERSION 43 | - sleep 10 44 | - sudo docker run --rm $( if [ "$SYMFONY_DEMO_VERSION" == "v1.0.5" ]; then printf %s "-e SYMFONY_PHPUNIT_VERSION=5.7.27"; fi; ) -e SYMFONY_DEPRECATIONS_HELPER=disabled -v $(pwd):/var/www kibatic/symfony-demo:$PHP_VERSION vendor/bin/simple-phpunit 45 | - curl -s localhost:8001 | grep -q "Symfony Demo application" 46 | - if [ "$SYMFONY_VERSION" = "4" ] || [ "$SYMFONY_VERSION" = "5" ]; then curl -s localhost:8001/_profiler/phpinfo | grep 'opcache.validate_timestampsOnOn'; fi; 47 | - docker kill symfony 48 | - sudo docker run -e PERFORMANCE_OPTIM=true --rm --name symfony -d -p 8001:80 -e SYMFONY_VERSION=$SYMFONY_VERSION -v $(pwd):/var/www kibatic/symfony-demo:$PHP_VERSION 49 | - sleep 10 50 | - curl -s localhost:8001 | grep -q "Symfony Demo application" 51 | - if [ "$SYMFONY_VERSION" = "4" ] || [ "$SYMFONY_VERSION" = "5" ]; then curl -s localhost:8001/_profiler/phpinfo | grep 'opcache.validate_timestampsOffOff'; fi 52 | 53 | notifications: 54 | email: true 55 | -------------------------------------------------------------------------------- /5.4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:wheezy 2 | 3 | MAINTAINER Elie Charra 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | 8 | COPY rootfs / 9 | 10 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --force-yes --no-install-recommends install \ 11 | supervisor \ 12 | ca-certificates \ 13 | nginx \ 14 | git \ 15 | php5 \ 16 | php5-cli \ 17 | php5-intl \ 18 | php5-fpm &&\ 19 | apt-get clean && \ 20 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\ 21 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 22 | --install-dir=/usr/local/bin \ 23 | --filename=composer &&\ 24 | sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php5/fpm/php.ini &&\ 25 | echo "daemon off;" >> /etc/nginx/nginx.conf 26 | 27 | RUN composer self-update 1.10.17 28 | 29 | RUN mkfifo /tmp/stdout && chmod 777 /tmp/stdout 30 | 31 | WORKDIR /var/www 32 | 33 | EXPOSE 80 34 | 35 | CMD ["/usr/bin/supervisord", "-n"] 36 | -------------------------------------------------------------------------------- /5.4/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | # Handle Symfony 3.x directory layout (var/...) and legacy layout (app/...) 6 | RW_FOLDERS=(var app/cache app/logs) 7 | 8 | for dir in "${RW_FOLDERS[@]}"; do 9 | if [ -d "$BASE_DIR$dir" ]; then 10 | echo "Fix permission for $BASE_DIR$dir" 11 | chown -R www-data $BASE_DIR$dir 12 | fi 13 | done 14 | 15 | exec /usr/bin/supervisord -n 16 | -------------------------------------------------------------------------------- /5.4/rootfs/etc/apt/sources.list: -------------------------------------------------------------------------------- 1 | deb http://archive.debian.org/debian/ wheezy main 2 | deb-src http://archive.debian.org/debian/ wheezy main 3 | deb http://archive.debian.org/debian-archive/debian-security/ wheezy updates/main 4 | -------------------------------------------------------------------------------- /5.4/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout; 2 | error_log /dev/stderr; 3 | 4 | -------------------------------------------------------------------------------- /5.4/rootfs/etc/nginx/sites-enabled/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass unix:/var/run/php5-fpm.sock; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /5.4/rootfs/etc/php5/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /5.4/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/bin/bash -c "tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log" 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | -------------------------------------------------------------------------------- /5.4/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /5.4/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php5-fpm --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | -------------------------------------------------------------------------------- /5.4/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kitpages/symfony:5.4 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install git php5-sqlite 5 | -------------------------------------------------------------------------------- /5.6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | 3 | MAINTAINER Elie Charra 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | 8 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 9 | supervisor \ 10 | ca-certificates \ 11 | nginx \ 12 | git \ 13 | php5 \ 14 | php5-cli \ 15 | php5-intl \ 16 | php5-fpm > /dev/null &&\ 17 | apt-get clean && \ 18 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\ 19 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 20 | --install-dir=/usr/local/bin \ 21 | --filename=composer &&\ 22 | sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php5/fpm/php.ini &&\ 23 | echo "daemon off;" >> /etc/nginx/nginx.conf 24 | 25 | RUN composer self-update 1.10.17 26 | 27 | COPY rootfs / 28 | 29 | ENV LOG_STREAM="/tmp/stdout" 30 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 31 | 32 | WORKDIR /var/www 33 | 34 | EXPOSE 80 35 | 36 | CMD ["/entrypoint.sh"] 37 | -------------------------------------------------------------------------------- /5.6/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | # Handle Symfony 3.x directory layout (var/...) and legacy layout (app/...) 6 | RW_FOLDERS=(var app/cache app/logs) 7 | 8 | for dir in "${RW_FOLDERS[@]}"; do 9 | if [ -d "$BASE_DIR$dir" ]; then 10 | echo "Fix permission for $BASE_DIR$dir" 11 | chown -R www-data $BASE_DIR$dir 12 | fi 13 | done 14 | 15 | exec /usr/bin/supervisord -n 16 | -------------------------------------------------------------------------------- /5.6/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout; 2 | error_log /dev/stderr; 3 | 4 | -------------------------------------------------------------------------------- /5.6/rootfs/etc/nginx/sites-enabled/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass unix:/var/run/php5-fpm.sock; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /5.6/rootfs/etc/php5/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /5.6/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/bin/bash -c "tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log" 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | -------------------------------------------------------------------------------- /5.6/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /5.6/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php5-fpm --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | [program:php-fpm-logs] 8 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 9 | stdout_logfile=/dev/stdout 10 | stdout_logfile_maxbytes=0 11 | redirect_stderr=true 12 | 13 | -------------------------------------------------------------------------------- /5.6/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:5.6 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install git php5-sqlite 5 | -------------------------------------------------------------------------------- /7.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch 2 | 3 | MAINTAINER Elie Charra 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | 8 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 9 | supervisor \ 10 | ca-certificates \ 11 | nginx \ 12 | git \ 13 | unzip \ 14 | php7.0 \ 15 | php7.0-cli \ 16 | php7.0-intl \ 17 | php7.0-xml \ 18 | php7.0-zip \ 19 | php7.0-mbstring \ 20 | php7.0-fpm > /dev/null &&\ 21 | apt-get clean && \ 22 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\ 23 | mkdir -p /run/php && \ 24 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 25 | --install-dir=/usr/local/bin \ 26 | --filename=composer &&\ 27 | sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.0/fpm/php.ini &&\ 28 | echo "daemon off;" >> /etc/nginx/nginx.conf 29 | 30 | RUN composer self-update 1.10.17 31 | 32 | COPY rootfs / 33 | 34 | ENV LOG_STREAM="/var/stdout" 35 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 36 | 37 | WORKDIR /var/www 38 | 39 | EXPOSE 80 40 | 41 | CMD ["/entrypoint.sh"] 42 | -------------------------------------------------------------------------------- /7.0/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | # Handle Symfony 3.x directory layout (var/...) and legacy layout (app/...) 6 | RW_FOLDERS=(var app/cache app/logs) 7 | 8 | for dir in "${RW_FOLDERS[@]}"; do 9 | if [ -d "$BASE_DIR$dir" ]; then 10 | echo "Fix permission for $BASE_DIR$dir" 11 | chown -R www-data $BASE_DIR$dir 12 | fi 13 | done 14 | 15 | exec /usr/bin/supervisord -n 16 | -------------------------------------------------------------------------------- /7.0/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /7.0/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout; 2 | error_log /dev/stderr; 3 | 4 | -------------------------------------------------------------------------------- /7.0/rootfs/etc/nginx/sites-enabled/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass unix:/run/php/php7.0-fpm.sock; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /7.0/rootfs/etc/php/7.0/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; maximum memory allocated to store the results 8 | realpath_cache_size=4096K 9 | 10 | ; save the results for 10 minutes (600 seconds) 11 | realpath_cache_ttl=600 12 | -------------------------------------------------------------------------------- /7.0/rootfs/etc/php/7.0/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /7.0/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /7.0/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /7.0/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm7.0 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | -------------------------------------------------------------------------------- /7.0/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.0 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install git php7.0-sqlite php7.0-xml php7.0-zip 5 | -------------------------------------------------------------------------------- /7.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch 2 | 3 | MAINTAINER Elie Charra 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | supervisor \ 11 | ca-certificates \ 12 | nginx \ 13 | wget \ 14 | apt-transport-https > /dev/null &&\ 15 | wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg &&\ 16 | echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list &&\ 17 | apt-get update -qq > /dev/null &&\ 18 | DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 19 | unzip \ 20 | php7.1 \ 21 | php7.1-cli \ 22 | php7.1-intl \ 23 | php7.1-fpm \ 24 | php7.1-xml \ 25 | php7.1-mbstring \ 26 | php7.1-zip > /dev/null &&\ 27 | apt-get clean && \ 28 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\ 29 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 30 | --install-dir=/usr/local/bin \ 31 | --filename=composer &&\ 32 | sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.1/fpm/php.ini &&\ 33 | echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 34 | mkdir -p /run/php 35 | 36 | RUN composer self-update 1.10.17 37 | 38 | COPY rootfs / 39 | 40 | ENV LOG_STREAM="/var/stdout" 41 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 42 | 43 | WORKDIR /var/www 44 | 45 | EXPOSE 80 46 | 47 | CMD ["/entrypoint.sh"] 48 | -------------------------------------------------------------------------------- /7.1/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | # Handle Symfony 3.x directory layout (var/...) and legacy layout (app/...) 6 | RW_FOLDERS=(var app/cache app/logs) 7 | 8 | for dir in "${RW_FOLDERS[@]}"; do 9 | if [ -d "$BASE_DIR$dir" ]; then 10 | echo "Fix permission for $BASE_DIR$dir" 11 | chown -R www-data $BASE_DIR$dir 12 | fi 13 | done 14 | 15 | NGINX_CONFIG=symfony3 16 | if [[ "$SYMFONY_VERSION" = "4" ]] 17 | then 18 | NGINX_CONFIG=symfony4 19 | fi 20 | 21 | # Avoid to remove a bind mounted nginx config 22 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 23 | if ! mountpoint -q $NGINX_DEFAULT; then 24 | echo "Using default nginx config : $NGINX_CONFIG" 25 | rm $NGINX_DEFAULT 26 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 27 | fi 28 | 29 | # Disable opcache optimisation for developpement 30 | # Allow files to be reloaded when update without restarting fpm process 31 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 32 | then 33 | echo "Disable performance optimisation" 34 | echo > /etc/php/7.1/fpm/conf.d/99-symfony.ini 35 | fi 36 | 37 | exec /usr/bin/supervisord -n 38 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | 4 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/nginx/sites-available/symfony3.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass unix:/run/php/php7.1-fpm.sock; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php7.1-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/php/7.1/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/php/7.1/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /7.1/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm7.1 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | -------------------------------------------------------------------------------- /7.1/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.1 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php7.1-sqlite3 5 | -------------------------------------------------------------------------------- /7.2-bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye 2 | 3 | MAINTAINER Philippe Le Van 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | supervisor \ 11 | ca-certificates \ 12 | nginx \ 13 | wget \ 14 | apt-transport-https > /dev/null &&\ 15 | wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg &&\ 16 | echo "deb https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list &&\ 17 | apt-get update -qq > /dev/null &&\ 18 | DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 19 | unzip \ 20 | php7.2 \ 21 | php7.2-cli \ 22 | php7.2-intl \ 23 | php7.2-fpm \ 24 | php7.2-xml \ 25 | php7.2-mbstring \ 26 | php7.2-zip > /dev/null &&\ 27 | apt-get clean && \ 28 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\ 29 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 30 | --install-dir=/usr/local/bin \ 31 | --filename=composer &&\ 32 | sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.2/fpm/php.ini &&\ 33 | echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 34 | mkdir -p /run/php 35 | 36 | RUN composer self-update 1.10.17 37 | 38 | COPY rootfs / 39 | 40 | ENV LOG_STREAM="/var/stdout" 41 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 42 | 43 | WORKDIR /var/www 44 | 45 | EXPOSE 80 46 | 47 | CMD ["/entrypoint.sh"] 48 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | # Handle Symfony 3.x directory layout (var/...) and legacy layout (app/...) 6 | RW_FOLDERS=(var app/cache app/logs) 7 | 8 | for dir in "${RW_FOLDERS[@]}"; do 9 | if [ -d "$BASE_DIR$dir" ]; then 10 | echo "Fix permission for $BASE_DIR$dir" 11 | chown -R www-data $BASE_DIR$dir 12 | fi 13 | done 14 | 15 | NGINX_CONFIG=symfony3 16 | if [[ "$SYMFONY_VERSION" = "4" ]] 17 | then 18 | NGINX_CONFIG=symfony4 19 | fi 20 | 21 | # Avoid to remove a bind mounted nginx config 22 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 23 | if ! mountpoint -q $NGINX_DEFAULT; then 24 | echo "Using default nginx config : $NGINX_CONFIG" 25 | rm $NGINX_DEFAULT 26 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 27 | fi 28 | 29 | # Disable opcache optimisation for developpement 30 | # Allow files to be reloaded when update without restarting fpm process 31 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 32 | then 33 | echo "Disable performance optimisation" 34 | echo > /etc/php/7.2/fpm/conf.d/99-symfony.ini 35 | fi 36 | 37 | exec /usr/bin/supervisord -n 38 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | 4 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/nginx/sites-available/symfony3.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass unix:/run/php/php7.2-fpm.sock; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php7.2-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/php/7.2/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/php/7.2/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /7.2-bullseye/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm7.2 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | [program:php-fpm-logs] 8 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 9 | stdout_logfile=/dev/stdout 10 | stdout_logfile_maxbytes=0 11 | redirect_stderr=true 12 | -------------------------------------------------------------------------------- /7.2-bullseye/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.2 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php7.2-sqlite3 5 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2-fpm-alpine 2 | 3 | MAINTAINER Philippe Le Van (https://framapiaf.org/@plv) 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | # mise à jour des packages 10 | RUN apk update --no-cache && \ 11 | apk upgrade --no-cache && \ 12 | apk add --no-cache \ 13 | bash \ 14 | supervisor \ 15 | ca-certificates \ 16 | nginx \ 17 | wget \ 18 | unzip \ 19 | icu-dev \ 20 | acl \ 21 | libxml2-dev \ 22 | libzip-dev \ 23 | grep \ 24 | tzdata 25 | 26 | RUN docker-php-ext-install \ 27 | intl \ 28 | bcmath \ 29 | zip \ 30 | opcache 31 | 32 | # install composer 33 | RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ 34 | php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" &&\ 35 | php composer-setup.php &&\ 36 | php -r "unlink('composer-setup.php');" &&\ 37 | mv composer.phar /usr/local/bin/composer &&\ 38 | composer self-update 1.10.17 39 | 40 | 41 | # config php 42 | RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" 43 | RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" "$PHP_INI_DIR/php.ini" && \ 44 | mkdir -p /run/php 45 | 46 | # config nginx 47 | RUN sed -i -e "s#include /etc/nginx/conf.d/\*.conf;#include /etc/nginx/conf.d/*.conf;\ninclude /etc/nginx/sites-enabled/\*;#g" /etc/nginx/nginx.conf &&\ 48 | echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 49 | mkdir -p /run/nginx &&\ 50 | mkdir -p /etc/nginx/sites-enabled &&\ 51 | rm /etc/nginx/conf.d/default.conf 52 | 53 | COPY rootfs / 54 | 55 | ENV LOG_STREAM="/var/stdout" 56 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 57 | 58 | WORKDIR /var/www 59 | 60 | EXPOSE 80 61 | 62 | CMD ["/entrypoint.sh"] 63 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | # Handle Symfony 3.x directory layout (var/...) and legacy layout (app/...) 6 | RW_FOLDERS=(var app/cache app/logs) 7 | 8 | for dir in "${RW_FOLDERS[@]}"; do 9 | if [ -d "$BASE_DIR$dir" ]; then 10 | echo "Fix permission for $BASE_DIR$dir" 11 | chown -R www-data $BASE_DIR$dir 12 | fi 13 | done 14 | 15 | NGINX_CONFIG=symfony3 16 | if [[ "$SYMFONY_VERSION" = "4" ]] 17 | then 18 | NGINX_CONFIG=symfony4 19 | fi 20 | 21 | # Avoid to remove a bind mounted nginx config 22 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 23 | if ! mountpoint -q $NGINX_DEFAULT; then 24 | echo "Using default nginx config : $NGINX_CONFIG" 25 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 26 | fi 27 | 28 | # Disable opcache optimisation for developpement 29 | # Allow files to be reloaded when update without restarting fpm process 30 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 31 | then 32 | echo "Disable performance optimisation" 33 | echo > /etc/php7/conf.d/99-symfony.ini 34 | fi 35 | 36 | exec /usr/bin/supervisord -n 37 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | 4 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/nginx/sites-available/symfony3.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass 127.0.0.1:9000; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass 127.0.0.1:9000; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/php7/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/php7/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/supervisor.d/app-log.ini: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/supervisor.d/nginx.ini: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/supervisor.d/php-fpm.ini: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/local/sbin/php-fpm --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | [program:php-fpm-logs] 8 | command=/usr/bin/tail -q -n 0 -f %(ENV_LOG_STREAM)s 9 | stdout_logfile=/dev/stdout 10 | stdout_logfile_maxbytes=0 11 | redirect_stderr=true 12 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/rootfs/etc/supervisord.conf.save: -------------------------------------------------------------------------------- 1 | ; Sample supervisor config file. 2 | ; 3 | ; For more information on the config file, please see: 4 | ; http://supervisord.org/configuration.html 5 | ; 6 | ; Notes: 7 | ; - Shell expansion ("~" or "$HOME") is not supported. Environment 8 | ; variables can be expanded using this syntax: "%(ENV_HOME)s". 9 | ; - Quotes around values are not supported, except in the case of 10 | ; the environment= options as shown below. 11 | ; - Comments must have a leading space: "a=b ;comment" not "a=b;comment". 12 | ; - Command will be truncated if it looks like a config file comment, e.g. 13 | ; "command=bash -c 'foo ; bar'" will truncate to "command=bash -c 'foo ". 14 | ; 15 | ; Warning: 16 | ; Paths throughout this example file use /tmp because it is available on most 17 | ; systems. You will likely need to change these to locations more appropriate 18 | ; for your system. Some systems periodically delete older files in /tmp. 19 | ; Notably, if the socket file defined in the [unix_http_server] section below 20 | ; is deleted, supervisorctl will be unable to connect to supervisord. 21 | 22 | [unix_http_server] 23 | file=/dev/shm/supervisor.sock 24 | chmod=0700 25 | ;file=/run/supervisord.sock ; the path to the socket file 26 | ;chmod=0700 ; socket file mode (default 0700) 27 | ;chown=nobody:nogroup ; socket file uid:gid owner 28 | ;username=user ; default is no username (open server) 29 | ;password=123 ; default is no password (open server) 30 | 31 | ; Security Warning: 32 | ; The inet HTTP server is not enabled by default. The inet HTTP server is 33 | ; enabled by uncommenting the [inet_http_server] section below. The inet 34 | ; HTTP server is intended for use within a trusted environment only. It 35 | ; should only be bound to localhost or only accessible from within an 36 | ; isolated, trusted network. The inet HTTP server does not support any 37 | ; form of encryption. The inet HTTP server does not use authentication 38 | ; by default (see the username= and password= options to add authentication). 39 | ; Never expose the inet HTTP server to the public internet. 40 | 41 | ;[inet_http_server] ; inet (TCP) server disabled by default 42 | ;port=127.0.0.1:9001 ; ip_address:port specifier, *:port for all iface 43 | ;username=user ; default is no username (open server) 44 | ;password=123 ; default is no password (open server) 45 | 46 | [supervisord] 47 | logfile=/var/log/supervisord.log ; main log file; default $CWD/supervisord.log 48 | ;logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB 49 | ;logfile_backups=10 ; # of main logfile backups; 0 means none, default 10 50 | ;loglevel=info ; log level; default info; others: debug,warn,trace 51 | ;pidfile=/run/supervisord.pid ; supervisord pidfile; default supervisord.pid 52 | ;nodaemon=false ; start in foreground if true; default false 53 | ;silent=false ; no logs to stdout if true; default false 54 | ;minfds=1024 ; min. avail startup file descriptors; default 1024 55 | ;minprocs=200 ; min. avail process descriptors;default 200 56 | ;umask=022 ; process file creation umask; default 022 57 | ;user=chrism ; setuid to this UNIX account at startup; recommended if root 58 | ;identifier=supervisor ; supervisord identifier, default is 'supervisor' 59 | ;directory=/tmp ; default is not to cd during start 60 | ;nocleanup=true ; don't clean up tempfiles at start; default false 61 | ;childlogdir=/var/log/supervisor ; 'AUTO' child log dir, default $TEMP 62 | ;environment=KEY="value" ; key value pairs to add to environment 63 | ;strip_ansi=false ; strip ansi escape codes in logs; def. false 64 | 65 | ; The rpcinterface:supervisor section must remain in the config file for 66 | ; RPC (supervisorctl/web interface) to work. Additional interfaces may be 67 | ; added by defining them in separate [rpcinterface:x] sections. 68 | 69 | [rpcinterface:supervisor] 70 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 71 | 72 | ; The supervisorctl section configures how supervisorctl will connect to 73 | ; supervisord. configure it match the settings in either the unix_http_server 74 | ; or inet_http_server section. 75 | 76 | [supervisorctl] 77 | serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix socket 78 | ;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket 79 | ;username=chris ; should be same as in [*_http_server] if set 80 | ;password=123 ; should be same as in [*_http_server] if set 81 | ;prompt=mysupervisor ; cmd line prompt (default "supervisor") 82 | ;history_file=~/.sc_history ; use readline history if available 83 | 84 | ; The sample program section below shows all possible program subsection values. 85 | ; Create one or more 'real' program: sections to be able to control them under 86 | ; supervisor. 87 | 88 | ;[program:theprogramname] 89 | ;command=/bin/cat ; the program (relative uses PATH, can take args) 90 | ;process_name=%(program_name)s ; process_name expr (default %(program_name)s) 91 | ;numprocs=1 ; number of processes copies to start (def 1) 92 | ;directory=/tmp ; directory to cwd to before exec (def no cwd) 93 | ;umask=022 ; umask for process (default None) 94 | ;priority=999 ; the relative start priority (default 999) 95 | ;autostart=true ; start at supervisord start (default: true) 96 | ;startsecs=1 ; # of secs prog must stay up to be running (def. 1) 97 | ;startretries=3 ; max # of serial start failures when starting (default 3) 98 | ;autorestart=unexpected ; when to restart if exited after running (def: unexpected) 99 | ;exitcodes=0 ; 'expected' exit codes used with autorestart (default 0) 100 | ;stopsignal=QUIT ; signal used to kill process (default TERM) 101 | ;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) 102 | ;stopasgroup=false ; send stop signal to the UNIX process group (default false) 103 | ;killasgroup=false ; SIGKILL the UNIX process group (def false) 104 | ;user=chrism ; setuid to this UNIX account to run the program 105 | ;redirect_stderr=true ; redirect proc stderr to stdout (default false) 106 | ;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO 107 | ;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 108 | ;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) 109 | ;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 110 | ;stdout_events_enabled=false ; emit events on stdout writes (default false) 111 | ;stdout_syslog=false ; send stdout to syslog with process name (default false) 112 | ;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO 113 | ;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 114 | ;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10) 115 | ;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 116 | ;stderr_events_enabled=false ; emit events on stderr writes (default false) 117 | ;stderr_syslog=false ; send stderr to syslog with process name (default false) 118 | ;environment=A="1",B="2" ; process environment additions (def no adds) 119 | ;serverurl=AUTO ; override serverurl computation (childutils) 120 | 121 | ; The sample eventlistener section below shows all possible eventlistener 122 | ; subsection values. Create one or more 'real' eventlistener: sections to be 123 | ; able to handle event notifications sent by supervisord. 124 | 125 | ;[eventlistener:theeventlistenername] 126 | ;command=/bin/eventlistener ; the program (relative uses PATH, can take args) 127 | ;process_name=%(program_name)s ; process_name expr (default %(program_name)s) 128 | ;numprocs=1 ; number of processes copies to start (def 1) 129 | ;events=EVENT ; event notif. types to subscribe to (req'd) 130 | ;buffer_size=10 ; event buffer queue size (default 10) 131 | ;directory=/tmp ; directory to cwd to before exec (def no cwd) 132 | ;umask=022 ; umask for process (default None) 133 | ;priority=-1 ; the relative start priority (default -1) 134 | ;autostart=true ; start at supervisord start (default: true) 135 | ;startsecs=1 ; # of secs prog must stay up to be running (def. 1) 136 | ;startretries=3 ; max # of serial start failures when starting (default 3) 137 | ;autorestart=unexpected ; autorestart if exited after running (def: unexpected) 138 | ;exitcodes=0 ; 'expected' exit codes used with autorestart (default 0) 139 | ;stopsignal=QUIT ; signal used to kill process (default TERM) 140 | ;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10) 141 | ;stopasgroup=false ; send stop signal to the UNIX process group (default false) 142 | ;killasgroup=false ; SIGKILL the UNIX process group (def false) 143 | ;user=chrism ; setuid to this UNIX account to run the program 144 | ;redirect_stderr=false ; redirect_stderr=true is not allowed for eventlisteners 145 | ;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO 146 | ;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 147 | ;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) 148 | ;stdout_events_enabled=false ; emit events on stdout writes (default false) 149 | ;stdout_syslog=false ; send stdout to syslog with process name (default false) 150 | ;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO 151 | ;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 152 | ;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10) 153 | ;stderr_events_enabled=false ; emit events on stderr writes (default false) 154 | ;stderr_syslog=false ; send stderr to syslog with process name (default false) 155 | ;environment=A="1",B="2" ; process environment additions 156 | ;serverurl=AUTO ; override serverurl computation (childutils) 157 | 158 | ; The sample group section below shows all possible group values. Create one 159 | ; or more 'real' group: sections to create "heterogeneous" process groups. 160 | 161 | ;[group:thegroupname] 162 | ;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions 163 | ;priority=999 ; the relative start priority (default 999) 164 | 165 | ; The [include] section can just contain the "files" setting. This 166 | ; setting can list multiple files (separated by whitespace or 167 | ; newlines). It can also contain wildcards. The filenames are 168 | ; interpreted as relative to this file. Included files *cannot* 169 | ; include files themselves. 170 | 171 | [include] 172 | files = /etc/supervisor.d/*.ini 173 | -------------------------------------------------------------------------------- /7.2-fpm-alpine/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.2 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php7.2-sqlite3 5 | -------------------------------------------------------------------------------- /7.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch 2 | 3 | MAINTAINER Elie Charra 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | supervisor \ 11 | ca-certificates \ 12 | nginx \ 13 | wget \ 14 | apt-transport-https > /dev/null &&\ 15 | wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg &&\ 16 | echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list &&\ 17 | apt-get update -qq > /dev/null &&\ 18 | DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 19 | unzip \ 20 | php7.2 \ 21 | php7.2-cli \ 22 | php7.2-intl \ 23 | php7.2-fpm \ 24 | php7.2-xml \ 25 | php7.2-mbstring \ 26 | php7.2-zip > /dev/null &&\ 27 | apt-get clean && \ 28 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\ 29 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 30 | --install-dir=/usr/local/bin \ 31 | --filename=composer &&\ 32 | sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.2/fpm/php.ini &&\ 33 | echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 34 | mkdir -p /run/php 35 | 36 | RUN composer self-update 1.10.17 37 | 38 | COPY rootfs / 39 | 40 | ENV LOG_STREAM="/var/stdout" 41 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 42 | 43 | WORKDIR /var/www 44 | 45 | EXPOSE 80 46 | 47 | CMD ["/entrypoint.sh"] 48 | -------------------------------------------------------------------------------- /7.2/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | # Handle Symfony 3.x directory layout (var/...) and legacy layout (app/...) 6 | RW_FOLDERS=(var app/cache app/logs) 7 | 8 | for dir in "${RW_FOLDERS[@]}"; do 9 | if [ -d "$BASE_DIR$dir" ]; then 10 | echo "Fix permission for $BASE_DIR$dir" 11 | chown -R www-data $BASE_DIR$dir 12 | fi 13 | done 14 | 15 | NGINX_CONFIG=symfony3 16 | if [[ "$SYMFONY_VERSION" = "4" ]] 17 | then 18 | NGINX_CONFIG=symfony4 19 | fi 20 | 21 | # Avoid to remove a bind mounted nginx config 22 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 23 | if ! mountpoint -q $NGINX_DEFAULT; then 24 | echo "Using default nginx config : $NGINX_CONFIG" 25 | rm $NGINX_DEFAULT 26 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 27 | fi 28 | 29 | # Disable opcache optimisation for developpement 30 | # Allow files to be reloaded when update without restarting fpm process 31 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 32 | then 33 | echo "Disable performance optimisation" 34 | echo > /etc/php/7.2/fpm/conf.d/99-symfony.ini 35 | fi 36 | 37 | exec /usr/bin/supervisord -n 38 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | 4 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/nginx/sites-available/symfony3.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass unix:/run/php/php7.2-fpm.sock; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php7.2-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/php/7.2/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/php/7.2/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /7.2/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm7.2 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | [program:php-fpm-logs] 8 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 9 | stdout_logfile=/dev/stdout 10 | stdout_logfile_maxbytes=0 11 | redirect_stderr=true 12 | -------------------------------------------------------------------------------- /7.2/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.2 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php7.2-sqlite3 5 | -------------------------------------------------------------------------------- /7.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye-slim 2 | 3 | MAINTAINER Kibatic 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | supervisor \ 11 | ca-certificates \ 12 | nginx \ 13 | wget \ 14 | apt-transport-https > /dev/null &&\ 15 | wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg &&\ 16 | echo "deb https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list &&\ 17 | apt-get update -qq > /dev/null &&\ 18 | DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 19 | unzip \ 20 | php7.3 \ 21 | php7.3-cli \ 22 | php7.3-intl \ 23 | php7.3-fpm \ 24 | php7.3-xml \ 25 | php7.3-mbstring \ 26 | php7.3-curl > /dev/null &&\ 27 | apt-get clean && \ 28 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\ 29 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 30 | --install-dir=/usr/local/bin \ 31 | --filename=composer &&\ 32 | echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 33 | mkdir -p /run/php 34 | 35 | COPY rootfs / 36 | 37 | WORKDIR /var/www 38 | 39 | EXPOSE 80 40 | 41 | CMD ["/entrypoint.sh"] 42 | -------------------------------------------------------------------------------- /7.3/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | RW_FOLDERS=(var) 6 | 7 | for dir in "${RW_FOLDERS[@]}"; do 8 | if [ -d "$BASE_DIR$dir" ]; then 9 | echo "Fix permission for $BASE_DIR$dir" 10 | chown -R www-data $BASE_DIR$dir 11 | fi 12 | done 13 | 14 | NGINX_CONFIG=symfony4 15 | if [[ "$SYMFONY_VERSION" = "3" ]] 16 | then 17 | NGINX_CONFIG=symfony3 18 | fi 19 | 20 | # Avoid to remove a bind mounted nginx config 21 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 22 | if ! mountpoint -q $NGINX_DEFAULT; then 23 | echo "Using default nginx config : $NGINX_CONFIG" 24 | rm $NGINX_DEFAULT 25 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 26 | fi 27 | 28 | # Disable opcache optimisation for developpement 29 | # Allow files to be reloaded when update without restarting fpm process 30 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 31 | then 32 | echo "Disable performance optimisation" 33 | echo > /etc/php/7.3/fpm/conf.d/99-symfony.ini 34 | fi 35 | 36 | exec /usr/bin/supervisord -n 37 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/nginx/sites-available/symfony3.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass unix:/run/php/php7.3-fpm.sock; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php7.3-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/php/7.3/fpm/conf.d/99-cgi.ini: -------------------------------------------------------------------------------- 1 | cgi.fix_pathinfo=0 2 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/php/7.3/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/php/7.3/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | log_level = warning 3 | log_limit = 16384 4 | error_log = /dev/stderr 5 | 6 | [www] 7 | clear_env = no 8 | catch_workers_output = yes 9 | decorate_workers_output = no 10 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /7.3/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm7.3 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | -------------------------------------------------------------------------------- /7.3/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.3 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php7.3-sqlite3 5 | 6 | RUN composer self-update --1 7 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-fpm-bullseye 2 | 3 | MAINTAINER Philippe Le Van (https://framapiaf.org/@plv) 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | apt-utils \ 11 | supervisor \ 12 | ca-certificates \ 13 | nginx \ 14 | wget \ 15 | vim \ 16 | git \ 17 | curl \ 18 | openssl \ 19 | make \ 20 | unzip \ 21 | libzip-dev \ 22 | libicu-dev \ 23 | apt-transport-https > /dev/null && \ 24 | apt-get clean && \ 25 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 26 | 27 | RUN docker-php-ext-install \ 28 | intl \ 29 | bcmath \ 30 | zip \ 31 | opcache 32 | 33 | # install composer 34 | RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ 35 | php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" &&\ 36 | php composer-setup.php &&\ 37 | php -r "unlink('composer-setup.php');" &&\ 38 | mv composer.phar /usr/local/bin/composer 39 | 40 | # config php 41 | RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" 42 | RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" "$PHP_INI_DIR/php.ini" && \ 43 | mkdir -p /run/php 44 | 45 | # config nginx 46 | #RUN sed -i -e "s#include /etc/nginx/conf.d/\*.conf;#include /etc/nginx/conf.d/*.conf;\ninclude /etc/nginx/sites-enabled/\*;#g" /etc/nginx/nginx.conf &&\ 47 | # echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 48 | # rm /etc/nginx/http.d/default.conf &&\ 49 | # mkdir -p /run/nginx &&\ 50 | # mkdir -p /etc/nginx/sites-enabled \ 51 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \ 52 | mkdir -p /run/php 53 | 54 | COPY rootfs / 55 | 56 | ENV LOG_STREAM="/var/stdout" 57 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 58 | 59 | WORKDIR /var/www 60 | 61 | EXPOSE 80 62 | 63 | CMD ["/entrypoint.sh"] 64 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | RW_FOLDERS=(var) 6 | 7 | for dir in "${RW_FOLDERS[@]}"; do 8 | if [ -d "$BASE_DIR$dir" ]; then 9 | echo "Fix permission for $BASE_DIR$dir" 10 | chown -R www-data $BASE_DIR$dir 11 | fi 12 | done 13 | 14 | SYMFONY_VERSION=${SYMFONY_VERSION:-5} 15 | NGINX_CONFIG=symfony$SYMFONY_VERSION 16 | 17 | # Avoid to remove a bind mounted nginx config 18 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 19 | if ! mountpoint -q $NGINX_DEFAULT; then 20 | echo "Using default nginx config : $NGINX_CONFIG" 21 | rm $NGINX_DEFAULT 22 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 23 | fi 24 | 25 | # Disable opcache optimisation for developpement 26 | # Allow files to be reloaded when update without restarting fpm process 27 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 28 | then 29 | echo "Disable performance optimisation" 30 | echo > /usr/local/etc/php/conf.d/99-symfony.ini 31 | fi 32 | 33 | exec /usr/bin/supervisord -n 34 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/nginx/sites-available/symfony3.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | 11 | location / { 12 | try_files $uri /app.php$is_args$args; 13 | } 14 | 15 | location ~ ^/(app|app_dev|config)\.php(/|$) { 16 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 17 | fastcgi_pass 127.0.0.1:9000; 18 | include fastcgi_params; 19 | # When you are using symlinks to link the document root to the 20 | # current version of your application, you should pass the real 21 | # application path instead of the path to the symlink to PHP 22 | # FPM. 23 | # Otherwise, PHP's OPcache may not properly detect changes to 24 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 25 | # for more information). 26 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 27 | fastcgi_param DOCUMENT_ROOT $realpath_root; 28 | 29 | # Prevents URIs that include the front controller. This will 404: 30 | # http://domain.tld/index.php/some-path 31 | # Remove the internal directive to allow URIs like this 32 | internal; 33 | } 34 | 35 | # return 404 for all other php files not matching the front controller 36 | # this prevents access to other php files you don't want to be accessible. 37 | location ~ \.php$ { 38 | return 404; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass 127.0.0.1:9000; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/nginx/sites-available/symfony5.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass 127.0.0.1:9000; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/local/sbin/php-fpm --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | [program:php-fpm-logs] 8 | command=/usr/bin/tail -q -n 0 -f %(ENV_LOG_STREAM)s 9 | stdout_logfile=/dev/stdout 10 | stdout_logfile_maxbytes=0 11 | redirect_stderr=true 12 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/usr/local/etc/php/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /7.4-fpm-bullseye/rootfs/usr/local/etc/php/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /7.4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4.33-zts-bullseye 2 | 3 | LABEL maintainer="Kibatic system@kibatic.com" 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | apt-utils \ 11 | supervisor \ 12 | ca-certificates \ 13 | nginx \ 14 | wget \ 15 | vim \ 16 | git \ 17 | curl \ 18 | openssl \ 19 | make \ 20 | unzip \ 21 | libicu-dev \ 22 | libzip-dev \ 23 | apt-transport-https > /dev/null && \ 24 | apt-get clean && \ 25 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 26 | 27 | # install php extensions 28 | RUN docker-php-ext-install \ 29 | intl \ 30 | bcmath \ 31 | zip \ 32 | opcache 33 | 34 | # TODO: php7.4-cli php7.4-xml php7.4-mbstring php7.4-curl ? 35 | 36 | # install composer 37 | RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ 38 | php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" &&\ 39 | php composer-setup.php &&\ 40 | php -r "unlink('composer-setup.php');" &&\ 41 | mv composer.phar /usr/local/bin/composer 42 | 43 | # configure nginx 44 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \ 45 | mkdir -p /run/php 46 | 47 | COPY rootfs / 48 | 49 | WORKDIR /var/www 50 | 51 | EXPOSE 80 52 | 53 | CMD ["/entrypoint.sh"] 54 | -------------------------------------------------------------------------------- /7.4/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | chown www-data /var/www/ /var/www/var/log 4 | 5 | SYMFONY_VERSION=${SYMFONY_VERSION:-5} 6 | NGINX_CONFIG=symfony$SYMFONY_VERSION 7 | 8 | # Avoid to remove a bind mounted nginx config 9 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 10 | if ! mountpoint -q $NGINX_DEFAULT; then 11 | echo "Using default nginx config : $NGINX_CONFIG" 12 | rm $NGINX_DEFAULT 13 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 14 | fi 15 | 16 | # Disable opcache optimisation for developpement 17 | # Allow files to be reloaded when update without restarting fpm process 18 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 19 | then 20 | echo "Disable performance optimisation" 21 | echo > /etc/php/7.4/fpm/conf.d/99-symfony.ini 22 | fi 23 | 24 | exec /usr/bin/supervisord -n 25 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/nginx/sites-available/symfony3.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/web; 10 | index index.html index.htm index.php; 11 | 12 | location / { 13 | try_files $uri /app.php$is_args$args; 14 | } 15 | 16 | location ~ ^/(app|app_dev|config)\.php(/|$) { 17 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 18 | fastcgi_pass unix:/run/php/php7.4-fpm.sock; 19 | include fastcgi_params; 20 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php7.4-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/nginx/sites-available/symfony5.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php7.4-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/php/7.4/fpm/conf.d/99-cgi.ini: -------------------------------------------------------------------------------- 1 | cgi.fix_pathinfo=0 2 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/php/7.4/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/php/7.4/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | log_level = warning 3 | log_limit = 16384 4 | error_log = /dev/stderr 5 | 6 | [www] 7 | clear_env = no 8 | catch_workers_output = yes 9 | decorate_workers_output = no 10 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /7.4/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm7.4 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | -------------------------------------------------------------------------------- /7.4/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.4 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php7.4-sqlite3 5 | -------------------------------------------------------------------------------- /8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye-slim 2 | 3 | LABEL maintainer="Kibatic system@kibatic.com" 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | apt-utils \ 11 | supervisor \ 12 | ca-certificates \ 13 | nginx \ 14 | wget \ 15 | vim \ 16 | git \ 17 | curl \ 18 | openssl \ 19 | make \ 20 | unzip \ 21 | apt-transport-https > /dev/null && \ 22 | apt-get clean && \ 23 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ 26 | echo "deb https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list && \ 27 | apt-get update -qq > /dev/null && \ 28 | DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 29 | php8.0 \ 30 | php8.0-cli \ 31 | php8.0-intl \ 32 | php8.0-fpm \ 33 | php8.0-xml \ 34 | php8.0-mbstring \ 35 | php8.0-curl > /dev/null && \ 36 | apt-get clean && \ 37 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 38 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 39 | --install-dir=/usr/local/bin \ 40 | --filename=composer && \ 41 | echo "daemon off;" >> /etc/nginx/nginx.conf && \ 42 | mkdir -p /run/php 43 | 44 | COPY rootfs / 45 | 46 | WORKDIR /var/www 47 | 48 | EXPOSE 80 49 | 50 | CMD ["/entrypoint.sh"] 51 | -------------------------------------------------------------------------------- /8.0/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | chown -R www-data:www-data /var/www/var 4 | 5 | SYMFONY_VERSION=${SYMFONY_VERSION:-5} 6 | NGINX_CONFIG=symfony$SYMFONY_VERSION 7 | 8 | # Avoid to remove a bind mounted nginx config 9 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 10 | if ! mountpoint -q $NGINX_DEFAULT; then 11 | echo "Using default nginx config : $NGINX_CONFIG" 12 | rm $NGINX_DEFAULT 13 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 14 | fi 15 | 16 | # Disable opcache optimisation for developpement 17 | # Allow files to be reloaded when update without restarting fpm process 18 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 19 | then 20 | echo "Disable performance optimisation" 21 | echo > /etc/php/8.0/fpm/conf.d/99-symfony.ini 22 | fi 23 | 24 | exec /usr/bin/supervisord -n 25 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php8.0-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/nginx/sites-available/symfony5.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php8.0-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/php/8.0/fpm/conf.d/99-cgi.ini: -------------------------------------------------------------------------------- 1 | cgi.fix_pathinfo=0 2 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/php/8.0/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/php/8.0/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | log_level = warning 3 | log_limit = 16384 4 | error_log = /dev/stderr 5 | 6 | [www] 7 | clear_env = no 8 | catch_workers_output = yes 9 | decorate_workers_output = no 10 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /8.0/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm8.0 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | -------------------------------------------------------------------------------- /8.0/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:8.0 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php8.0-sqlite3 5 | -------------------------------------------------------------------------------- /8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye-slim 2 | 3 | LABEL maintainer="Kibatic system@kibatic.com" 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | apt-utils \ 11 | supervisor \ 12 | ca-certificates \ 13 | nginx \ 14 | wget \ 15 | vim \ 16 | git \ 17 | curl \ 18 | openssl \ 19 | make \ 20 | unzip \ 21 | apt-transport-https > /dev/null && \ 22 | apt-get clean && \ 23 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ 26 | echo "deb https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list && \ 27 | apt-get update -qq > /dev/null && \ 28 | DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 29 | php8.1 \ 30 | php8.1-cli \ 31 | php8.1-intl \ 32 | php8.1-fpm \ 33 | php8.1-xml \ 34 | php8.1-mbstring \ 35 | php8.1-curl > /dev/null && \ 36 | apt-get clean && \ 37 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 38 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 39 | --install-dir=/usr/local/bin \ 40 | --filename=composer && \ 41 | echo "daemon off;" >> /etc/nginx/nginx.conf && \ 42 | mkdir -p /run/php 43 | 44 | COPY rootfs / 45 | 46 | WORKDIR /var/www 47 | 48 | EXPOSE 80 49 | 50 | CMD ["/entrypoint.sh"] 51 | -------------------------------------------------------------------------------- /8.1/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | chown -R www-data:www-data /var/www/var 4 | 5 | SYMFONY_VERSION=${SYMFONY_VERSION:-5} 6 | NGINX_CONFIG=symfony$SYMFONY_VERSION 7 | 8 | # Avoid to remove a bind mounted nginx config 9 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 10 | if ! mountpoint -q $NGINX_DEFAULT; then 11 | echo "Using default nginx config : $NGINX_CONFIG" 12 | rm $NGINX_DEFAULT 13 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 14 | fi 15 | 16 | # Disable opcache optimisation for developpement 17 | # Allow files to be reloaded when update without restarting fpm process 18 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 19 | then 20 | echo "Disable performance optimisation" 21 | echo > /etc/php/8.1/fpm/conf.d/99-symfony.ini 22 | fi 23 | 24 | exec /usr/bin/supervisord -n 25 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php8.1-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/nginx/sites-available/symfony5.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php8.1-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/php/8.1/fpm/conf.d/99-cgi.ini: -------------------------------------------------------------------------------- 1 | cgi.fix_pathinfo=0 2 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/php/8.1/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/php/8.1/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | log_level = warning 3 | log_limit = 16384 4 | error_log = /dev/stderr 5 | 6 | [www] 7 | clear_env = no 8 | catch_workers_output = yes 9 | decorate_workers_output = no 10 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /8.1/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm8.1 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | -------------------------------------------------------------------------------- /8.1/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:8.1 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php8.1-sqlite3 5 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-fpm-alpine 2 | 3 | MAINTAINER Philippe Le Van (https://framapiaf.org/@plv) 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | # mise à jour des packages 10 | RUN apk update --no-cache && \ 11 | apk upgrade --no-cache && \ 12 | apk add --no-cache \ 13 | bash \ 14 | supervisor \ 15 | ca-certificates \ 16 | nginx \ 17 | git \ 18 | wget \ 19 | unzip \ 20 | icu-dev \ 21 | icu-data-full \ 22 | acl \ 23 | libxml2-dev \ 24 | libzip-dev \ 25 | grep \ 26 | tzdata 27 | 28 | RUN docker-php-ext-install \ 29 | intl \ 30 | bcmath \ 31 | zip \ 32 | opcache 33 | 34 | # install composer 35 | RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ 36 | php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ 37 | php composer-setup.php &&\ 38 | php -r "unlink('composer-setup.php');" &&\ 39 | mv composer.phar /usr/local/bin/composer 40 | 41 | # config php 42 | RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" 43 | RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" "$PHP_INI_DIR/php.ini" && \ 44 | mkdir -p /run/php 45 | 46 | # config nginx 47 | RUN sed -i -e "s#include /etc/nginx/conf.d/\*.conf;#include /etc/nginx/conf.d/*.conf;\ninclude /etc/nginx/sites-enabled/\*;#g" /etc/nginx/nginx.conf &&\ 48 | echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 49 | rm /etc/nginx/http.d/default.conf &&\ 50 | mkdir -p /run/nginx &&\ 51 | mkdir -p /etc/nginx/sites-enabled 52 | COPY rootfs / 53 | 54 | ENV LOG_STREAM="/var/stdout" 55 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 56 | 57 | WORKDIR /var/www 58 | 59 | EXPOSE 80 60 | 61 | CMD ["/entrypoint.sh"] 62 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | RW_FOLDERS=(var) 6 | 7 | for dir in "${RW_FOLDERS[@]}"; do 8 | if [ -d "$BASE_DIR$dir" ]; then 9 | echo "Fix permission for $BASE_DIR$dir" 10 | chown -R www-data $BASE_DIR$dir 11 | fi 12 | done 13 | 14 | # Disable opcache optimisation for developpement 15 | # Allow files to be reloaded when update without restarting fpm process 16 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 17 | then 18 | echo "Disable performance optimisation" 19 | echo > /usr/local/etc/php/conf.d/99-symfony.ini 20 | fi 21 | 22 | exec /usr/bin/supervisord -n 23 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/etc/nginx/http.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/etc/nginx/http.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/etc/nginx/http.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/etc/nginx/http.d/symfony.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/http.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass 127.0.0.1:9000; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/etc/supervisor.d/app-log.ini: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/etc/supervisor.d/nginx.ini: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/etc/supervisor.d/php-fpm.ini: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/local/sbin/php-fpm --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | [program:php-fpm-logs] 8 | command=/usr/bin/tail -q -n 0 -f %(ENV_LOG_STREAM)s 9 | stdout_logfile=/dev/stdout 10 | stdout_logfile_maxbytes=0 11 | redirect_stderr=true 12 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/usr/local/etc/php/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/rootfs/usr/local/etc/php/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /8.2-fpm-alpine/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.2 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php7.2-sqlite3 5 | -------------------------------------------------------------------------------- /8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye-slim 2 | 3 | LABEL maintainer="Kibatic system@kibatic.com" 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | apt-utils \ 11 | supervisor \ 12 | ca-certificates \ 13 | nginx \ 14 | wget \ 15 | vim \ 16 | git \ 17 | curl \ 18 | openssl \ 19 | make \ 20 | unzip \ 21 | apt-transport-https > /dev/null && \ 22 | apt-get clean && \ 23 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 | 25 | RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ 26 | echo "deb https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/php.list && \ 27 | apt-get update -qq > /dev/null && \ 28 | DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 29 | php8.2 \ 30 | php8.2-cli \ 31 | php8.2-intl \ 32 | php8.2-fpm \ 33 | php8.2-xml \ 34 | php8.2-mbstring \ 35 | php8.2-curl > /dev/null && \ 36 | apt-get clean && \ 37 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 38 | php -r "readfile('https://getcomposer.org/installer');" | php -- \ 39 | --install-dir=/usr/local/bin \ 40 | --filename=composer && \ 41 | echo "daemon off;" >> /etc/nginx/nginx.conf && \ 42 | mkdir -p /run/php 43 | 44 | COPY rootfs / 45 | 46 | WORKDIR /var/www 47 | 48 | EXPOSE 80 49 | 50 | CMD ["/entrypoint.sh"] 51 | -------------------------------------------------------------------------------- /8.2/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | chown -R www-data:www-data /var/www/var 4 | 5 | SYMFONY_VERSION=${SYMFONY_VERSION:-5} 6 | NGINX_CONFIG=symfony$SYMFONY_VERSION 7 | 8 | # Avoid to remove a bind mounted nginx config 9 | NGINX_DEFAULT=/etc/nginx/sites-enabled/default 10 | if ! mountpoint -q $NGINX_DEFAULT; then 11 | echo "Using default nginx config : $NGINX_CONFIG" 12 | rm $NGINX_DEFAULT 13 | ln -s /etc/nginx/sites-available/$NGINX_CONFIG.conf $NGINX_DEFAULT 14 | fi 15 | 16 | # Disable opcache optimisation for developpement 17 | # Allow files to be reloaded when update without restarting fpm process 18 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 19 | then 20 | echo "Disable performance optimisation" 21 | echo > /etc/php/8.2/fpm/conf.d/99-symfony.ini 22 | fi 23 | 24 | exec /usr/bin/supervisord -n 25 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/nginx/sites-available/symfony4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php8.2-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/nginx/sites-available/symfony5.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass unix:/run/php/php8.2-fpm.sock; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/php/8.2/fpm/conf.d/99-cgi.ini: -------------------------------------------------------------------------------- 1 | cgi.fix_pathinfo=0 2 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/php/8.2/fpm/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/php/8.2/fpm/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | log_level = warning 3 | log_limit = 16384 4 | error_log = /dev/stderr 5 | 6 | [www] 7 | clear_env = no 8 | catch_workers_output = yes 9 | decorate_workers_output = no 10 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /8.2/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/sbin/php-fpm8.2 --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | -------------------------------------------------------------------------------- /8.2/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:8.2 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php8.2-sqlite3 5 | -------------------------------------------------------------------------------- /8.3-fpm-debian/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-fpm-bookworm 2 | 3 | MAINTAINER Philippe Le Van (https://framapiaf.org/@plv) 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | apt-utils \ 11 | supervisor \ 12 | ca-certificates \ 13 | nginx \ 14 | wget \ 15 | vim \ 16 | git \ 17 | curl \ 18 | openssl \ 19 | make \ 20 | unzip \ 21 | libzip-dev \ 22 | libicu-dev \ 23 | apt-transport-https > /dev/null && \ 24 | apt-get clean && \ 25 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 26 | 27 | RUN docker-php-ext-install \ 28 | intl \ 29 | bcmath \ 30 | zip \ 31 | opcache 32 | 33 | # install composer 34 | RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ 35 | php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" &&\ 36 | php composer-setup.php &&\ 37 | php -r "unlink('composer-setup.php');" &&\ 38 | mv composer.phar /usr/local/bin/composer 39 | 40 | # config php 41 | RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" 42 | RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" "$PHP_INI_DIR/php.ini" && \ 43 | mkdir -p /run/php 44 | 45 | # config nginx 46 | #RUN sed -i -e "s#include /etc/nginx/conf.d/\*.conf;#include /etc/nginx/conf.d/*.conf;\ninclude /etc/nginx/sites-enabled/\*;#g" /etc/nginx/nginx.conf &&\ 47 | # echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 48 | # rm /etc/nginx/http.d/default.conf &&\ 49 | # mkdir -p /run/nginx &&\ 50 | # mkdir -p /etc/nginx/sites-enabled \ 51 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \ 52 | mkdir -p /run/php 53 | 54 | COPY rootfs / 55 | 56 | ENV LOG_STREAM="/var/stdout" 57 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 58 | 59 | WORKDIR /var/www 60 | 61 | EXPOSE 80 62 | 63 | CMD ["/entrypoint.sh"] 64 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | RW_FOLDERS=(var) 6 | 7 | for dir in "${RW_FOLDERS[@]}"; do 8 | if [ -d "$BASE_DIR$dir" ]; then 9 | echo "Fix permission for $BASE_DIR$dir" 10 | chown -R www-data $BASE_DIR$dir 11 | fi 12 | done 13 | 14 | # Disable opcache optimisation for developpement 15 | # Allow files to be reloaded when update without restarting fpm process 16 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 17 | then 18 | echo "Disable performance optimisation" 19 | echo > /usr/local/etc/php/conf.d/99-symfony.ini 20 | fi 21 | 22 | exec /usr/bin/supervisord -n 23 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/etc/nginx/sites-available/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass 127.0.0.1:9000; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/local/sbin/php-fpm --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | [program:php-fpm-logs] 8 | command=/usr/bin/tail -q -n 0 -f %(ENV_LOG_STREAM)s 9 | stdout_logfile=/dev/stdout 10 | stdout_logfile_maxbytes=0 11 | redirect_stderr=true 12 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/usr/local/etc/php/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /8.3-fpm-debian/rootfs/usr/local/etc/php/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /8.3-fpm-debian/tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kibatic/symfony:7.2 2 | 3 | RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive\ 4 | apt-get -qq -y install php7.2-sqlite3 5 | -------------------------------------------------------------------------------- /8.4-fpm-debian/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.4-fpm-bookworm 2 | 3 | MAINTAINER Philippe Le Van (https://framapiaf.org/@plv) 4 | 5 | # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser 6 | ENV COMPOSER_ALLOW_SUPERUSER 1 7 | ENV PERFORMANCE_OPTIM false 8 | 9 | RUN apt-get -qq update > /dev/null && DEBIAN_FRONTEND=noninteractive apt-get -qq -y --no-install-recommends install \ 10 | apt-utils \ 11 | supervisor \ 12 | ca-certificates \ 13 | nginx \ 14 | wget \ 15 | vim \ 16 | git \ 17 | curl \ 18 | openssl \ 19 | make \ 20 | unzip \ 21 | libzip-dev \ 22 | libicu-dev \ 23 | apt-transport-https > /dev/null && \ 24 | apt-get clean && \ 25 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 26 | 27 | RUN docker-php-ext-install \ 28 | intl \ 29 | bcmath \ 30 | zip \ 31 | opcache 32 | 33 | # install composer 34 | RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ 35 | php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" &&\ 36 | php composer-setup.php &&\ 37 | php -r "unlink('composer-setup.php');" &&\ 38 | mv composer.phar /usr/local/bin/composer 39 | 40 | # config php 41 | RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" 42 | RUN sed -i -e "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" "$PHP_INI_DIR/php.ini" && \ 43 | mkdir -p /run/php 44 | 45 | # config nginx 46 | #RUN sed -i -e "s#include /etc/nginx/conf.d/\*.conf;#include /etc/nginx/conf.d/*.conf;\ninclude /etc/nginx/sites-enabled/\*;#g" /etc/nginx/nginx.conf &&\ 47 | # echo "daemon off;" >> /etc/nginx/nginx.conf &&\ 48 | # rm /etc/nginx/http.d/default.conf &&\ 49 | # mkdir -p /run/nginx &&\ 50 | # mkdir -p /etc/nginx/sites-enabled \ 51 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf && \ 52 | mkdir -p /run/php 53 | 54 | 55 | ENV LOG_STREAM="/var/stdout" 56 | RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM 57 | 58 | WORKDIR /var/www 59 | 60 | EXPOSE 80 61 | 62 | COPY rootfs / 63 | 64 | CMD ["/entrypoint.sh"] 65 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/enable-blackfire.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # go to the script directory 4 | ROOT_DIR=$(dirname "${0}") 5 | cd ${ROOT_DIR} 6 | 7 | # help message 8 | function display_help() { 9 | echo "${0} [--help]" 10 | echo " --on enable-blackfire" 11 | echo " --off disable-blackfire" 12 | echo " --server-id blackfire server id (can be defined by env vars)" 13 | echo " --server-token blackfire server token (can be defined by env vars)" 14 | echo 15 | echo " Ex:" 16 | echo " ${0} --on" 17 | echo " ${0} --off" 18 | echo " ${0} --on --server-id 1234567890abcde --server-token 1234567890abcde" 19 | } 20 | 21 | while test $# -gt 0; do 22 | _key="$1" 23 | case "$_key" in 24 | --help) 25 | display_help 26 | exit 0 27 | ;; 28 | --on) 29 | ACTION="ON" 30 | ;; 31 | --off) 32 | ACTION="OFF" 33 | ;; 34 | --server-id) 35 | BLACKFIRE_SERVER_ID=$2 36 | shift 37 | ;; 38 | --server-token) 39 | BLACKFIRE_SERVER_TOKEN=$2 40 | shift 41 | ;; 42 | esac 43 | shift 44 | done 45 | 46 | if [[ $ACTION == "ON" ]]; then 47 | if [ -z $BLACKFIRE_SERVER_ID ] || [ -z $BLACKFIRE_SERVER_TOKEN ] || [ -z $BLACKFIRE_CLIENT_ID ] || [ -z $BLACKFIRE_CLIENT_TOKEN ]; then 48 | echo "BLACKFIRE_SERVER_ID and BLACKFIRE_SERVER_TOKEN must be set (for example in the environment part of a docker-compose.yml file)" 49 | display_help 50 | exit 1 51 | fi 52 | 53 | wget -q -O - https://packages.blackfire.io/gpg.key | dd of=/usr/share/keyrings/blackfire-archive-keyring.asc 54 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/blackfire-archive-keyring.asc] http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list 55 | 56 | apt-get -qqq update && DEBIAN_FRONTEND=noninteractive apt-get install -qqq -y blackfire 57 | 58 | blackfire agent:config --server-id=${BLACKFIRE_SERVER_ID} --server-token=${BLACKFIRE_SERVER_TOKEN} 59 | service blackfire-agent restart 60 | 61 | apt-get install -qqq -y blackfire-php 62 | supervisorctl restart php-fpm 63 | 64 | 65 | blackfire client:config --client-id=${BLACKFIRE_CLIENT_ID} --client-token=${BLACKFIRE_CLIENT_TOKEN} 66 | exit 0 67 | fi 68 | 69 | if [[ $ACTION == "OFF" ]]; then 70 | service blackfire-agent stop 71 | killall blackfire 72 | exit 0 73 | fi 74 | 75 | echo "Invalid action" 76 | display_help 77 | exit 1 78 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BASE_DIR=/var/www/ 4 | # Following folders must be writables by www-data web user 5 | RW_FOLDERS=(var) 6 | 7 | for dir in "${RW_FOLDERS[@]}"; do 8 | if [ -d "$BASE_DIR$dir" ]; then 9 | echo "Fix permission for $BASE_DIR$dir" 10 | chown -R www-data $BASE_DIR$dir 11 | fi 12 | done 13 | 14 | # Disable opcache optimisation for developpement 15 | # Allow files to be reloaded when update without restarting fpm process 16 | if [[ "$PERFORMANCE_OPTIM" = "false" ]] 17 | then 18 | echo "Disable performance optimisation" 19 | echo > /usr/local/etc/php/conf.d/99-symfony.ini 20 | fi 21 | 22 | exec /usr/bin/supervisord -n 23 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/etc/nginx/conf.d/docker/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 5; 2 | gzip_proxied no-cache no-store private expired auth; 3 | gzip_vary on; 4 | gzip_types 5 | application/atom+xml 6 | application/javascript 7 | application/json 8 | application/ld+json 9 | application/manifest+json 10 | application/rss+xml 11 | application/vnd.geo+json 12 | application/vnd.ms-fontobject 13 | application/font-woff 14 | application/x-font-ttf 15 | application/x-web-app-manifest+json 16 | application/xhtml+xml 17 | application/xml 18 | font/opentype 19 | image/bmp 20 | image/svg+xml 21 | image/x-icon 22 | text/cache-manifest 23 | text/css 24 | text/plain 25 | text/vcard 26 | text/vnd.rim.location.xloc 27 | text/vtt 28 | text/x-component 29 | text/x-cross-domain-policy; 30 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/etc/nginx/conf.d/docker/logs.conf: -------------------------------------------------------------------------------- 1 | access_log /dev/stdout docker; 2 | error_log /dev/stderr; 3 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/etc/nginx/conf.d/logs.conf: -------------------------------------------------------------------------------- 1 | log_format docker '$remote_addr ($http_x_forwarded_for) - $remote_user [$time_local] ' 2 | '"$host" "$request" $status $body_bytes_sent ' 3 | '"$http_referer" "$http_user_agent"'; 4 | 5 | 6 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/etc/nginx/sites-available/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server ipv6only=on; 4 | 5 | include /etc/nginx/conf.d/docker/*.conf; 6 | 7 | server_name localhost; 8 | 9 | root /var/www/public; 10 | 11 | location / { 12 | # try to serve file directly, fallback to index.php 13 | try_files $uri /index.php$is_args$args; 14 | } 15 | 16 | location ~ ^/index\.php(/|$) { 17 | fastcgi_pass 127.0.0.1:9000; 18 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 19 | include fastcgi_params; 20 | 21 | # When you are using symlinks to link the document root to the 22 | # current version of your application, you should pass the real 23 | # application path instead of the path to the symlink to PHP 24 | # FPM. 25 | # Otherwise, PHP's OPcache may not properly detect changes to 26 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 27 | # for more information). 28 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 29 | fastcgi_param DOCUMENT_ROOT $realpath_root; 30 | 31 | # Prevents URIs that include the front controller. This will 404: 32 | # http://domain.tld/index.php/some-path 33 | # Remove the internal directive to allow URIs like this 34 | internal; 35 | } 36 | 37 | # return 404 for all other php files not matching the front controller 38 | # this prevents access to other php files you don't want to be accessible. 39 | location ~ \.php$ { 40 | return 404; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/etc/supervisor/conf.d/app-log.conf: -------------------------------------------------------------------------------- 1 | [program:app-log] 2 | command=/usr/bin/tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | 6 | [program:php-fpm-logs] 7 | command=/usr/bin/tail -q -n 0 --follow=descriptor --retry %(ENV_LOG_STREAM)s 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | redirect_stderr=true 11 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/etc/supervisor/conf.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | stderr_logfile=/dev/stderr 6 | stderr_logfile_maxbytes=0 7 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/etc/supervisor/conf.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command=/usr/local/sbin/php-fpm --nodaemonize 3 | stdout_logfile=/dev/stdout 4 | stdout_logfile_maxbytes=0 5 | redirect_stderr=true 6 | 7 | [program:php-fpm-logs] 8 | command=/usr/bin/tail -q -n 0 -f %(ENV_LOG_STREAM)s 9 | stdout_logfile=/dev/stdout 10 | stdout_logfile_maxbytes=0 11 | redirect_stderr=true 12 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/usr/local/etc/php/conf.d/99-symfony.ini: -------------------------------------------------------------------------------- 1 | ; maximum memory that OPcache can use to store compiled PHP files 2 | opcache.memory_consumption=256 3 | 4 | ; maximum number of files that can be stored in the cache 5 | opcache.max_accelerated_files=20000 6 | 7 | ; In production servers, PHP files should never change, unless a new application version is deployed. 8 | ; However, by default OPcache checks if cached files have changed their contents since they were cached. 9 | ; This check introduces some overhead that can be avoided as follows: 10 | opcache.validate_timestamps=0 11 | 12 | ; maximum memory allocated to store the results 13 | realpath_cache_size=4096K 14 | 15 | ; save the results for 10 minutes (600 seconds) 16 | realpath_cache_ttl=600 17 | -------------------------------------------------------------------------------- /8.4-fpm-debian/rootfs/usr/local/etc/php/pool.d/www_kibatic.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | clear_env = no 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![symfony-docker](http://i.imgur.com/vc5ZVqL.png?2) 2 | 3 | Symfony + Nginx + php-fpm 4 | ========================= 5 | 6 | [![Build Status](https://travis-ci.org/kibatic/symfony-docker.svg?branch=master)](https://travis-ci.org/kibatic/symfony-docker) 7 | [![](https://images.microbadger.com/badges/image/kibatic/symfony:latest.svg)](https://microbadger.com/images/kibatic/symfony:latest "Get your own image badge on microbadger.com") 8 | [![](https://images.microbadger.com/badges/version/kibatic/symfony:latest.svg)](https://microbadger.com/images/kibatic/symfony:latest "Get your own version badge on microbadger.com") 9 | 10 | 11 | Docker for Symfony application, powered by **Nginx** and **php-fpm**. 12 | 13 | Based on Debian Jessie. 14 | 15 | If you are experiencing some issues, take a look at [TROUBLESHOOTING](TROUBLESHOOTING.md) 16 | 17 | 18 | Supported tags and respective `Dockerfile` links 19 | ------------------------------------------------ 20 | 21 | Image tags follows PHP versions 22 | 23 | `latest` `8.1` [(8.1/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/8.1/Dockerfile) 24 | 25 | `8.0` [(8.0/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/8.0/Dockerfile) 26 | 27 | `7` `7.4` [(7.4/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/7.4/Dockerfile) 28 | 29 | `7.3` [(7.3/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/7.3/Dockerfile) 30 | 31 | `7.2` [(7.2/Dockerfile)](https://github.com/kibatic/symfony-docker/blob/master/7.2/Dockerfile) 32 | 33 | `7.1` **Not maintained, END OF LIFE** 34 | 35 | `7.0` **Not maintained, END OF LIFE** 36 | 37 | `5`, `5.6` **Not maintained, END OF LIFE** 38 | 39 | `5.4` **Not maintained, END OF LIFE** 40 | 41 | Compatibility matrix 42 | -------------------- 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 |
Symfony
Image2.x3.x4.x5.x6.x
8.1:x::x::heavy_check_mark: (not tested):heavy_check_mark: (not tested):heavy_check_mark: (not tested)
8.0:x::x::heavy_check_mark: (not tested):heavy_check_mark: (default):heavy_check_mark: (not tested)
7.4:x::x::heavy_check_mark::heavy_check_mark: (default):x:
7.3:heavy_check_mark: (not tested):heavy_check_mark: (not tested):heavy_check_mark: (default):heavy_check_mark: (not tested):x:
7.2:heavy_check_mark: (not tested):heavy_check_mark::heavy_check_mark::heavy_check_mark: (not tested):x:
7.1:heavy_check_mark: (not tested):heavy_check_mark::heavy_check_mark::x::x:
7.0:heavy_check_mark: (not tested):heavy_check_mark: (not tested):x::x::x:
5.6:heavy_check_mark: (not tested):heavy_check_mark: (not tested):x::x::x:
127 | 128 | Composer versions : 129 | 130 | - 8.0+ : 2.x 131 | - 7.4 : 2.x 132 | - 7.3 : 1.10.17 133 | - 7.2 : 1.10.17 134 | 135 | Usage 136 | ----- 137 | 138 | ### Basic Usage 139 | 140 | ```bash 141 | docker pull kibatic/symfony 142 | ``` 143 | 144 | Then run in your symfony folder 145 | 146 | ```bash 147 | # Image >= 7.3 & Symfony 2.x, 3.x 148 | docker run -e SYMFONY_VERSION=3 -v $(pwd):/var/www -p 8080:80 kibatic/symfony:7.3 149 | 150 | # Image >= 7.3 & Symfony 4.x 151 | docker run -v $(pwd):/var/www -p 8080:80 kibatic/symfony:7.3 152 | 153 | # Image < 7.3 & Symfony 2.x, 3.x 154 | docker run -v $(pwd):/var/www -p 8080:80 kibatic/symfony:7.2 155 | 156 | # Image < 7.3 & Symfony 4.x 157 | docker run -e SYMFONY_VERSION=4 -v $(pwd):/var/www -p 8080:80 kibatic/symfony:7.2 158 | ``` 159 | 160 | Symfony app will be accessible on http://localhost:8080/ 161 | 162 | 163 | ### use of blackfire (PHP >= 8.4) 164 | 165 | Add the following vars in the docker-compose file : 166 | 167 | 168 | ```yaml 169 | web: 170 | build: . 171 | volumes: 172 | - .:/var/www 173 | environment: 174 | PERFORMANCE_OPTIM: "false" 175 | BLACKFIRE_SERVER_ID: 3xxxx-xxxxx-xxxxxx-xxxxxxx-xxc 176 | BLACKFIRE_SERVER_TOKEN: 5d6cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc47fb 177 | BLACKFIRE_CLIENT_ID: 8exxxxx-xxx-xxxxx-xxxxxx-xx5 178 | BLACKFIRE_CLIENT_TOKEN: 6caaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx012 179 | ``` 180 | 181 | Then to enable or disalble blackfire : 182 | 183 | ```bash 184 | # enable blackfire 185 | docker compose exec -T web /enable-blackfire.sh --on 186 | 187 | # disable blackfire 188 | docker compose exec -T web /enable-blackfire.sh --off 189 | ``` 190 | 191 | In our project, we use a Makefile to simplify the commands (from the container or from the host) : 192 | 193 | ```makefile 194 | _enable-blackfire: ## enable blackfire 195 | /enable-blackfire.sh --on 196 | 197 | enable-blackfire: ## enable blackfire 198 | docker compose exec -T web make _enable-blackfire 199 | 200 | _disable-blackfire: ## disable blackfire 201 | /enable-blackfire.sh --off 202 | 203 | disable-blackfire: ## disable blackfire 204 | docker compose exec -T web make _disable-blackfire 205 | ``` 206 | 207 | Custom nginx configuration 208 | -------------------------- 209 | 210 | If you want to replace the default nginx settings, overwrite configuration file at `/etc/nginx/sites-enabled/default`. 211 | 212 | ```dockerfile 213 | COPY nginx.conf /etc/nginx/sites-enabled/default 214 | ``` 215 | 216 | You may also want to add only some directives in [existing site config](7.4/rootfs/etc/nginx/sites-enabled/default#L5). 217 | 218 | ```dockerfile 219 | COPY custom-config.conf /etc/nginx/conf.d/docker/custom-config.conf 220 | ``` 221 | 222 | Logging 223 | ------ 224 | 225 | ### Logging (PHP >= 7.3) 226 | 227 | For both production and dev environment you should log to stdout / stderr, example below. 228 | 229 | ```yaml 230 | # config/packages/monolog.yaml 231 | monolog: 232 | handlers: 233 | stdout: 234 | type: stream 235 | path: 'php://stdout' 236 | level: debug 237 | channels: ['!event'] 238 | # (Optional) format logs to json 239 | #formatter: monolog.formatter.json 240 | stderr: 241 | type: stream 242 | path: 'php://stderr' 243 | level: error 244 | # (Optional) format logs to json 245 | #formatter: monolog.formatter.json 246 | ``` 247 | 248 | 249 | ### Logging (PHP < 7.3) 250 | 251 | A common practice is to log to stdout, but there are major bug in php-fpm wich makes stdout logging not reliable : 252 | 253 | * Logs are truncated when message length exceed 1024 https://bugs.php.net/bug.php?id=69031 254 | * FPM prepend a warning string to worker output https://bugs.php.net/bug.php?id=71880 255 | 256 | This image setup a known workaround ([see here](https://github.com/docker-library/php/issues/207)) and expose a log stream as env var **LOG_STREAM**, but **you cannot log to stdout** 257 | For a proper logging you have to configure monolog to log to this stream 258 | 259 | ```yaml 260 | # app/config_dev.yml 261 | monolog: 262 | handlers: 263 | main: 264 | type: stream 265 | path: '/tmp/stdout' 266 | level: debug 267 | ``` 268 | 269 | You can also use symfony `%env(LOG_STREAM)%` if your symfony version is compatible with [this syntax](https://symfony.com/doc/3.4/configuration/external_parameters.html) 270 | 271 | We also provide a default dirty solution for standard monolog configuration, **this is not recommended in production** 272 | 273 | ```bash 274 | tail -q -n 0 -F app/logs/dev.log app/logs/prod.log var/logs/dev.log var/logs/prod.log 275 | ``` 276 | 277 | Minimal package included 278 | ------------------------ 279 | 280 | * nginx 281 | * php\*-fpm 282 | * php\*-cli 283 | * php\*-intl 284 | * php\*-mbstring 285 | 286 | Exposed port 287 | ------------ 288 | 289 | * 80 : nginx 290 | 291 | 292 | -------------------------------------------------------------------------------- /TROUBLESHOOTING.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | ### 502 Bad gateway 4 | 5 | If you have setup your Symfony project before **v2.4.0-BETA1** you have following handlers in your `config_dev.yml` 6 | 7 | ```yml 8 | monolog: 9 | chromephp: 10 | type: chromephp 11 | level: info 12 | ``` 13 | 14 | This configuration is generating very HUGE headers wich break Nginx default limit. 15 | 16 | ``` 17 | [error] 28#0: *2 upstream sent too big header while reading response header from upstream 18 | ``` 19 | 20 | A solution could be to remove chromephp handler. 21 | If you want to use this handler, you have to increase Nginx buffer limits with custom directives. 22 | 23 | ```nginx 24 | fastcgi_buffers 16 512k; 25 | fastcgi_buffer_size 512k; 26 | ``` 27 | 28 | Look at the [README](README.md#custom-nginx-configuration) how to load custom directives. 29 | 30 | Check Symfony related [PR](https://github.com/symfony/symfony-standard/commit/c6497663a511925631127ae88c99dc611efedcbe) for more details. 31 | --------------------------------------------------------------------------------