From 45b2d246341a5d784deef382d1a345fb01056bad Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Thu, 27 Dec 2018 11:05:51 +0100 Subject: [PATCH 1/9] ADD added unzip to apt-get install for composer ADD added /root/.composer/vendor/bin to PATH MOD PEAR: phing package depcrecated install via composer MOD sed command failed. MOD nginx-site.conf moved to /etc/nginx/conf.d/ instead of /etc/nginx/sites-enabled/default DEL removed mcrypt for php7.2 and php7.3 deprecated --- generate.sh | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/generate.sh b/generate.sh index 2b4eef8..8249148 100755 --- a/generate.sh +++ b/generate.sh @@ -25,7 +25,11 @@ for version in "${versions[@]}"; do package="php${version}-fpm" binary="php-fpm${version}" config="/etc/php/${version}/fpm/php-fpm.conf" - extensions="sqlite3 pgsql mysql mcrypt mbstring intl gd curl xml xsl xdebug zip" + extensions="sqlite3 pgsql mysql mbstring intl gd curl xml xsl xdebug zip" + if [[ ${version} == "5.6" || ${version} == "7.0" || ${version} == "7.1" ]]; then + # mcrypt deprecated in 7.1 and removed in 7.2 (https://secure.php.net/manual/en/migration71.deprecated.php, https://secure.php.net/manual/en/migration72.other-changes.php) + extensions="${extensions} mcrypt" + fi extensionsDisable="xdebug" extensionsPackages="" cliBinary="php${version}" @@ -55,7 +59,7 @@ for version in "${versions[@]}"; do RUN apt-get update \\ && apt-get -y dist-upgrade \\ - && apt-get install -y software-properties-common language-pack-en-base language-pack-de git \\ + && apt-get install -y software-properties-common language-pack-en-base language-pack-de git unzip \\ && LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/${ppa} \\ && apt-get update \\ && echo "Package: *\nPin: release o=${ppaPinName}\nPin-Priority: 1001" > /etc/apt/preferences.d/ondrej \\ @@ -74,18 +78,34 @@ for version in "${versions[@]}"; do && ${cliBinary} composer-setup.php --install-dir=/usr/local/bin --filename=composer \\ && rm composer-setup.php + ENV PATH="${PATH}:/root/.composer/vendor/bin" + + DOCKERFILE + + if [[ ${version} == "5.6" || ${version} == "7.0" || ${version} == "7.1" || ${version} == "7.2" ]]; then + cat <<- DOCKERFILE >> ${file} # install phing RUN export PHP_PEAR_PHP_BIN=${cliBinary} \\ && pear channel-discover pear.phing.info \\ && pear install phing/phing + DOCKERFILE + else + cat <<- DOCKERFILE >> ${file} + # install phing + RUN composer global require phing/phing + + DOCKERFILE + fi + + cat <<- DOCKERFILE >> ${file} # Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> ${file} COPY php-fpm.conf ${config} CMD ["${binary}"] DOCKERFILE - # do some code-styling for Dockerfile readability - sed -i '' -e "s|^&&|$(printf '\t')\&\&|g" ${file} + # do some code-styling for Dockerfile readability + sed -i -e "s|^&&|$(printf '\t')\&\&|g" "${file}" cp php-fpm.conf ${directory} @@ -125,13 +145,13 @@ for version in "${versions[@]}"; do && ln -sf /dev/stderr /var/log/nginx/error.log COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf - COPY nginx-site.conf /etc/nginx/sites-enabled/default + COPY nginx-site.conf /etc/nginx/conf.d/default.conf CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] DOCKERFILE # do some code-styling for Dockerfile readability - sed -i '' -e "s|^&&|$(printf '\t')\&\&|g" ${file} + sed -i -e "s|^&&|$(printf '\t')\&\&|g" ${file} cat <<- SUPERVISOR > ${supervisor} [supervisord] From 1d96d7a80ae3f72d5951cc52c5068fb86cf5d7fa Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Thu, 27 Dec 2018 11:06:44 +0100 Subject: [PATCH 2/9] latest: 7.3 --- push.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/push.sh b/push.sh index 4ac85f1..e1572f0 100755 --- a/push.sh +++ b/push.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -docker tag 25thfloor/php-fpm:7.1 25thfloor/php-fpm:latest -docker tag 25thfloor/php-nginx:7.1 25thfloor/php-nginx:latest +docker tag 25thfloor/php-fpm:7.3 25thfloor/php-fpm:latest +docker tag 25thfloor/php-nginx:7.3 25thfloor/php-nginx:latest docker push 25thfloor/php-nginx docker push 25thfloor/php-fpm From 3838758781330b7dad9832e8ecb6d23547c8f262 Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Thu, 27 Dec 2018 11:07:35 +0100 Subject: [PATCH 3/9] newly generated 7.1, 7.2 and 7.3 --- 7.1/fpm/Dockerfile | 8 +++++--- 7.1/nginx/Dockerfile | 2 +- 7.2/fpm/Dockerfile | 41 ++++++++++++++++++++++++++++++++++++++ 7.2/fpm/php-fpm.conf | 33 ++++++++++++++++++++++++++++++ 7.2/nginx/Dockerfile | 24 ++++++++++++++++++++++ 7.2/nginx/nginx-site.conf | 38 +++++++++++++++++++++++++++++++++++ 7.2/nginx/supervisord.conf | 25 +++++++++++++++++++++++ 7.3/fpm/Dockerfile | 41 ++++++++++++++++++++++++++++++++++++++ 7.3/fpm/php-fpm.conf | 33 ++++++++++++++++++++++++++++++ 7.3/nginx/Dockerfile | 24 ++++++++++++++++++++++ 7.3/nginx/nginx-site.conf | 38 +++++++++++++++++++++++++++++++++++ 7.3/nginx/supervisord.conf | 25 +++++++++++++++++++++++ 12 files changed, 328 insertions(+), 4 deletions(-) create mode 100644 7.2/fpm/Dockerfile create mode 100644 7.2/fpm/php-fpm.conf create mode 100644 7.2/nginx/Dockerfile create mode 100644 7.2/nginx/nginx-site.conf create mode 100644 7.2/nginx/supervisord.conf create mode 100644 7.3/fpm/Dockerfile create mode 100644 7.3/fpm/php-fpm.conf create mode 100644 7.3/nginx/Dockerfile create mode 100644 7.3/nginx/nginx-site.conf create mode 100644 7.3/nginx/supervisord.conf diff --git a/7.1/fpm/Dockerfile b/7.1/fpm/Dockerfile index a0567f8..58730e0 100644 --- a/7.1/fpm/Dockerfile +++ b/7.1/fpm/Dockerfile @@ -12,16 +12,16 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update \ && apt-get -y dist-upgrade \ - && apt-get install -y software-properties-common language-pack-en-base language-pack-de git \ + && apt-get install -y software-properties-common language-pack-en-base language-pack-de git unzip \ && LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php \ && apt-get update \ && echo "Package: *\nPin: release o=LP-PPA-ondrej-php5\nPin-Priority: 1001" > /etc/apt/preferences.d/ondrej \ - && apt-get install -y php7.1-fpm php7.1-sqlite3 php7.1-pgsql php7.1-mysql php7.1-mcrypt php7.1-mbstring php7.1-intl php7.1-gd php7.1-curl php7.1-xml php7.1-xsl php7.1-xdebug php7.1-zip \ + && apt-get install -y php7.1-fpm php7.1-sqlite3 php7.1-pgsql php7.1-mysql php7.1-mbstring php7.1-intl php7.1-gd php7.1-curl php7.1-xml php7.1-xsl php7.1-xdebug php7.1-zip php7.1-mcrypt \ && apt-get install -y php-pear \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN phpenmod -v 7.1 -s ALL sqlite3 pgsql mysql mcrypt mbstring intl gd curl xml xsl xdebug zip +RUN phpenmod -v 7.1 -s ALL sqlite3 pgsql mysql mbstring intl gd curl xml xsl xdebug zip mcrypt # supply but disable xdebug; can be enabled by custom volume-mount ini file RUN phpdismod -v 7.1 -s ALL xdebug @@ -31,6 +31,8 @@ RUN php7.1 -r 'readfile("https://getcomposer.org/installer");' > composer-setup. && php7.1 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php +ENV PATH="/home/mbandion/.nvm/versions/node/v10.12.0/bin:/home/mbandion/.local/bin:/home/mbandion/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mbandion/.antigen/bundles/zsh-users/zsh-syntax-highlighting:/home/mbandion/.antigen/bundles/zsh-users/zsh-history-substring-search:/home/mbandion/.antigen/bundles/zsh-users/zsh-autosuggestions:/home/mbandion/.antigen/bundles/arzzen/calc.plugin.zsh:~/bin:~/Applications:/root/.composer/vendor/bin" + # install phing RUN export PHP_PEAR_PHP_BIN=php7.1 \ && pear channel-discover pear.phing.info \ diff --git a/7.1/nginx/Dockerfile b/7.1/nginx/Dockerfile index 4ebaf08..5751029 100644 --- a/7.1/nginx/Dockerfile +++ b/7.1/nginx/Dockerfile @@ -19,6 +19,6 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && ln -sf /dev/stderr /var/log/nginx/error.log COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf -COPY nginx-site.conf /etc/nginx/sites-enabled/default +COPY nginx-site.conf /etc/nginx/conf.d/default.conf CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/7.2/fpm/Dockerfile b/7.2/fpm/Dockerfile new file mode 100644 index 0000000..9ebc724 --- /dev/null +++ b/7.2/fpm/Dockerfile @@ -0,0 +1,41 @@ +# Beware: This file is generated by the generate.sh script! +FROM ubuntu:14.04 +MAINTAINER 25th-floor GmbH +EXPOSE 9000 + +ENV DEBIAN_FRONTEND noninteractive + ENV TZ=Europe/Vienna + + RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ +&& echo $TZ > /etc/timezone \ +&& dpkg-reconfigure -f noninteractive tzdata + +RUN apt-get update \ +&& apt-get -y dist-upgrade \ +&& apt-get install -y software-properties-common language-pack-en-base language-pack-de git \ +&& LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php \ +&& apt-get update \ +&& echo "Package: *\nPin: release o=LP-PPA-ondrej-php5\nPin-Priority: 1001" > /etc/apt/preferences.d/ondrej \ +&& apt-get install -y php7.2-fpm php7.2-sqlite3 php7.2-pgsql php7.2-mysql php7.2-mbstring php7.2-intl php7.2-gd php7.2-curl php7.2-xml php7.2-xsl php7.2-xdebug php7.2-zip \ +&& apt-get install -y php-pear \ +&& apt-get clean \ +&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN phpenmod -v 7.2 -s ALL sqlite3 pgsql mysql mcrypt mbstring intl gd curl xml xsl xdebug zip + +# supply but disable xdebug; can be enabled by custom volume-mount ini file +RUN phpdismod -v 7.2 -s ALL xdebug + +# install composer +RUN php7.2 -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \ +&& php7.2 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ +&& rm composer-setup.php + +# install phing +RUN export PHP_PEAR_PHP_BIN=php7.2 \ +&& pear channel-discover pear.phing.info \ +&& pear install phing/phing + +# Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> 7.2/fpm/Dockerfile +COPY php-fpm.conf /etc/php/7.2/fpm/php-fpm.conf +CMD ["php-fpm7.2"] diff --git a/7.2/fpm/php-fpm.conf b/7.2/fpm/php-fpm.conf new file mode 100644 index 0000000..4d7f9d0 --- /dev/null +++ b/7.2/fpm/php-fpm.conf @@ -0,0 +1,33 @@ + +[global] + +error_log = /proc/1/fd/2 +daemonize = no + +[www] + +access.log = /proc/1/fd/1 + +user = www-data +group = www-data + +listen = 9000 + +pm = dynamic +pm.max_children = 10 +pm.start_servers = 3 +pm.min_spare_servers = 2 +pm.max_spare_servers = 5 +pm.max_requests = 500 + +pm.status_path = /fpm-status +ping.path = /fpm-ping + +; Ensure worker stdout and stderr are sent to the main error log. +catch_workers_output = yes + +; php settings +php_admin_value[error_log] = /proc/1/fd/2 +php_admin_value[upload_max_filesize] = 30M +php_admin_value[post_max_size] = 30M +php_admin_flag[log_errors] = on diff --git a/7.2/nginx/Dockerfile b/7.2/nginx/Dockerfile new file mode 100644 index 0000000..6283bcb --- /dev/null +++ b/7.2/nginx/Dockerfile @@ -0,0 +1,24 @@ +# Beware: This file is generated by the generate.sh script! +FROM 25thfloor/php-fpm:7.2 +MAINTAINER 25th-floor GmbH +EXPOSE 80 + +ENV TZ=Europe/Vienna + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ +&& echo $TZ > /etc/timezone \ +&& dpkg-reconfigure -f noninteractive tzdata \ +&& apt-key adv --fetch-keys http://nginx.org/keys/nginx_signing.key \ +&& echo "deb http://nginx.org/packages/mainline/ubuntu/ `grep -oP 'DISTRIB_CODENAME=\K.*' /etc/lsb-release` nginx" >> /etc/apt/sources.list.d/nginx.list \ +&& cat /etc/apt/sources.list.d/nginx.list \ +&& apt-get update \ +&& apt-get install -y supervisor nginx \ +&& apt-get clean \ +&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ +&& ln -sf /dev/stdout /var/log/nginx/access.log \ +&& ln -sf /dev/stderr /var/log/nginx/error.log + +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY nginx-site.conf /etc/nginx/conf.d/default.conf + +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/7.2/nginx/nginx-site.conf b/7.2/nginx/nginx-site.conf new file mode 100644 index 0000000..3398efe --- /dev/null +++ b/7.2/nginx/nginx-site.conf @@ -0,0 +1,38 @@ +upstream php { + server 127.0.0.1:9000; +} + +server { + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; + + set_real_ip_from 172.0.0.0/8; + real_ip_header X-Forwarded-For; + real_ip_recursive on; + + charset utf-8; + + root /var/www; + index index.php index.html index.htm; + + location / { + try_files $uri $uri/ /index.php?$query_string =404; + } + + location ~ \.php$ { + include fastcgi_params; + + fastcgi_pass php; + fastcgi_index index.php; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_connect_timeout 60; + fastcgi_send_timeout 1200; + fastcgi_read_timeout 1200; + fastcgi_buffer_size 1024k; + fastcgi_buffers 4 1024k; + fastcgi_busy_buffers_size 1024k; + fastcgi_temp_file_write_size 1024k; + fastcgi_intercept_errors on; + } +} diff --git a/7.2/nginx/supervisord.conf b/7.2/nginx/supervisord.conf new file mode 100644 index 0000000..6614df0 --- /dev/null +++ b/7.2/nginx/supervisord.conf @@ -0,0 +1,25 @@ +[supervisord] +nodaemon=true +loglevel=debug +logfile=/proc/1/fd/1 +logfile_maxbytes=0 + +[program:php-fpm] +command=php-fpm7.2 +autostart=true +autorestart=true +redirect_stderr=true +stdout_logfile=/proc/1/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/proc/1/fd/2 +stderr_logfile_maxbytes=0 + +[program:nginx] +command=nginx -g "daemon off;" +autostart=true +autorestart=true +redirect_stderr=true +stdout_logfile=/proc/1/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/proc/1/fd/2 +stderr_logfile_maxbytes=0 diff --git a/7.3/fpm/Dockerfile b/7.3/fpm/Dockerfile new file mode 100644 index 0000000..61e573e --- /dev/null +++ b/7.3/fpm/Dockerfile @@ -0,0 +1,41 @@ +# Beware: This file is generated by the generate.sh script! +FROM ubuntu:14.04 +MAINTAINER 25th-floor GmbH +EXPOSE 9000 + +ENV DEBIAN_FRONTEND noninteractive + ENV TZ=Europe/Vienna + + RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ + && echo $TZ > /etc/timezone \ + && dpkg-reconfigure -f noninteractive tzdata + +RUN apt-get update \ + && apt-get -y dist-upgrade \ + && apt-get install -y software-properties-common language-pack-en-base language-pack-de git unzip \ + && LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php \ + && apt-get update \ + && echo "Package: *\nPin: release o=LP-PPA-ondrej-php5\nPin-Priority: 1001" > /etc/apt/preferences.d/ondrej \ + && apt-get install -y php7.3-fpm php7.3-sqlite3 php7.3-pgsql php7.3-mysql php7.3-mbstring php7.3-intl php7.3-gd php7.3-curl php7.3-xml php7.3-xsl php7.3-xdebug php7.3-zip \ + && apt-get install -y php-pear \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN phpenmod -v 7.3 -s ALL sqlite3 pgsql mysql mbstring intl gd curl xml xsl xdebug zip + +# supply but disable xdebug; can be enabled by custom volume-mount ini file +RUN phpdismod -v 7.3 -s ALL xdebug + +# install composer +RUN php7.3 -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \ + && php7.3 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ + && rm composer-setup.php + +ENV PATH="/home/mbandion/.nvm/versions/node/v10.12.0/bin:/home/mbandion/.local/bin:/home/mbandion/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mbandion/.antigen/bundles/zsh-users/zsh-syntax-highlighting:/home/mbandion/.antigen/bundles/zsh-users/zsh-history-substring-search:/home/mbandion/.antigen/bundles/zsh-users/zsh-autosuggestions:/home/mbandion/.antigen/bundles/arzzen/calc.plugin.zsh:~/bin:~/Applications:/root/.composer/vendor/bin" + +# install phing +RUN composer global require phing/phing + +# Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> 7.3/fpm/Dockerfile +COPY php-fpm.conf /etc/php/7.3/fpm/php-fpm.conf +CMD ["php-fpm7.3"] diff --git a/7.3/fpm/php-fpm.conf b/7.3/fpm/php-fpm.conf new file mode 100644 index 0000000..4d7f9d0 --- /dev/null +++ b/7.3/fpm/php-fpm.conf @@ -0,0 +1,33 @@ + +[global] + +error_log = /proc/1/fd/2 +daemonize = no + +[www] + +access.log = /proc/1/fd/1 + +user = www-data +group = www-data + +listen = 9000 + +pm = dynamic +pm.max_children = 10 +pm.start_servers = 3 +pm.min_spare_servers = 2 +pm.max_spare_servers = 5 +pm.max_requests = 500 + +pm.status_path = /fpm-status +ping.path = /fpm-ping + +; Ensure worker stdout and stderr are sent to the main error log. +catch_workers_output = yes + +; php settings +php_admin_value[error_log] = /proc/1/fd/2 +php_admin_value[upload_max_filesize] = 30M +php_admin_value[post_max_size] = 30M +php_admin_flag[log_errors] = on diff --git a/7.3/nginx/Dockerfile b/7.3/nginx/Dockerfile new file mode 100644 index 0000000..48c9d36 --- /dev/null +++ b/7.3/nginx/Dockerfile @@ -0,0 +1,24 @@ +# Beware: This file is generated by the generate.sh script! +FROM 25thfloor/php-fpm:7.3 +MAINTAINER 25th-floor GmbH +EXPOSE 80 + +ENV TZ=Europe/Vienna + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ + && echo $TZ > /etc/timezone \ + && dpkg-reconfigure -f noninteractive tzdata \ + && apt-key adv --fetch-keys http://nginx.org/keys/nginx_signing.key \ + && echo "deb http://nginx.org/packages/mainline/ubuntu/ `grep -oP 'DISTRIB_CODENAME=\K.*' /etc/lsb-release` nginx" >> /etc/apt/sources.list.d/nginx.list \ + && cat /etc/apt/sources.list.d/nginx.list \ + && apt-get update \ + && apt-get install -y supervisor nginx \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && ln -sf /dev/stdout /var/log/nginx/access.log \ + && ln -sf /dev/stderr /var/log/nginx/error.log + +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY nginx-site.conf /etc/nginx/conf.d/default.conf + +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/7.3/nginx/nginx-site.conf b/7.3/nginx/nginx-site.conf new file mode 100644 index 0000000..3398efe --- /dev/null +++ b/7.3/nginx/nginx-site.conf @@ -0,0 +1,38 @@ +upstream php { + server 127.0.0.1:9000; +} + +server { + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; + + set_real_ip_from 172.0.0.0/8; + real_ip_header X-Forwarded-For; + real_ip_recursive on; + + charset utf-8; + + root /var/www; + index index.php index.html index.htm; + + location / { + try_files $uri $uri/ /index.php?$query_string =404; + } + + location ~ \.php$ { + include fastcgi_params; + + fastcgi_pass php; + fastcgi_index index.php; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_connect_timeout 60; + fastcgi_send_timeout 1200; + fastcgi_read_timeout 1200; + fastcgi_buffer_size 1024k; + fastcgi_buffers 4 1024k; + fastcgi_busy_buffers_size 1024k; + fastcgi_temp_file_write_size 1024k; + fastcgi_intercept_errors on; + } +} diff --git a/7.3/nginx/supervisord.conf b/7.3/nginx/supervisord.conf new file mode 100644 index 0000000..e06e246 --- /dev/null +++ b/7.3/nginx/supervisord.conf @@ -0,0 +1,25 @@ +[supervisord] +nodaemon=true +loglevel=debug +logfile=/proc/1/fd/1 +logfile_maxbytes=0 + +[program:php-fpm] +command=php-fpm7.3 +autostart=true +autorestart=true +redirect_stderr=true +stdout_logfile=/proc/1/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/proc/1/fd/2 +stderr_logfile_maxbytes=0 + +[program:nginx] +command=nginx -g "daemon off;" +autostart=true +autorestart=true +redirect_stderr=true +stdout_logfile=/proc/1/fd/1 +stdout_logfile_maxbytes=0 +stderr_logfile=/proc/1/fd/2 +stderr_logfile_maxbytes=0 From 1bbfd1ec942b4334b6bb25beec09a070c5fd7512 Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Fri, 4 Jan 2019 10:33:28 +0100 Subject: [PATCH 4/9] escapted PATH env var --- generate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate.sh b/generate.sh index 8249148..69ada1b 100755 --- a/generate.sh +++ b/generate.sh @@ -78,7 +78,7 @@ for version in "${versions[@]}"; do && ${cliBinary} composer-setup.php --install-dir=/usr/local/bin --filename=composer \\ && rm composer-setup.php - ENV PATH="${PATH}:/root/.composer/vendor/bin" + ENV PATH="\${PATH}:/root/.composer/vendor/bin" DOCKERFILE From fd60107649c137c0b9a6096f6a02ea110cb6b9a4 Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Fri, 4 Jan 2019 10:34:44 +0100 Subject: [PATCH 5/9] added hirak/prestissimo --- generate.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/generate.sh b/generate.sh index 69ada1b..29ae9d6 100755 --- a/generate.sh +++ b/generate.sh @@ -77,6 +77,7 @@ for version in "${versions[@]}"; do RUN ${cliBinary} -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \\ && ${cliBinary} composer-setup.php --install-dir=/usr/local/bin --filename=composer \\ && rm composer-setup.php + RUN composer global require hirak/prestissimo ENV PATH="\${PATH}:/root/.composer/vendor/bin" From b260952fc94d1b158e62e963b1b5284a6d23d125 Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Fri, 4 Jan 2019 10:35:37 +0100 Subject: [PATCH 6/9] removed phing --- generate.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/generate.sh b/generate.sh index 29ae9d6..a32028a 100755 --- a/generate.sh +++ b/generate.sh @@ -83,22 +83,6 @@ for version in "${versions[@]}"; do DOCKERFILE - if [[ ${version} == "5.6" || ${version} == "7.0" || ${version} == "7.1" || ${version} == "7.2" ]]; then - cat <<- DOCKERFILE >> ${file} - # install phing - RUN export PHP_PEAR_PHP_BIN=${cliBinary} \\ - && pear channel-discover pear.phing.info \\ - && pear install phing/phing - - DOCKERFILE - else - cat <<- DOCKERFILE >> ${file} - # install phing - RUN composer global require phing/phing - - DOCKERFILE - fi - cat <<- DOCKERFILE >> ${file} # Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> ${file} COPY php-fpm.conf ${config} From e00301e6d009782c3655823142e1962f7ce296d7 Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Fri, 4 Jan 2019 10:36:14 +0100 Subject: [PATCH 7/9] fixed whitespaces --- generate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate.sh b/generate.sh index a32028a..5ca6ca6 100755 --- a/generate.sh +++ b/generate.sh @@ -51,9 +51,9 @@ for version in "${versions[@]}"; do EXPOSE 9000 ENV DEBIAN_FRONTEND noninteractive - ENV TZ=${TZ} + ENV TZ=${TZ} - RUN ln -snf /usr/share/zoneinfo/\$TZ /etc/localtime \\ + RUN ln -snf /usr/share/zoneinfo/\$TZ /etc/localtime \\ && echo \$TZ > /etc/timezone \\ && dpkg-reconfigure -f noninteractive tzdata From 097d398d53c2cdd3d9389d643feeee92646d604c Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Fri, 4 Jan 2019 10:46:30 +0100 Subject: [PATCH 8/9] newly generated all Dockerfile --- 5.6/fpm/Dockerfile | 16 +++++++--------- 7.0/fpm/Dockerfile | 16 +++++++--------- 7.1/fpm/Dockerfile | 12 ++++-------- 7.2/fpm/Dockerfile | 40 +++++++++++++++++++--------------------- 7.3/fpm/Dockerfile | 10 ++++------ 7.3/nginx/Dockerfile | 2 +- 6 files changed, 42 insertions(+), 54 deletions(-) diff --git a/5.6/fpm/Dockerfile b/5.6/fpm/Dockerfile index a5d115a..d142252 100644 --- a/5.6/fpm/Dockerfile +++ b/5.6/fpm/Dockerfile @@ -4,24 +4,24 @@ MAINTAINER 25th-floor GmbH EXPOSE 9000 ENV DEBIAN_FRONTEND noninteractive - ENV TZ=Europe/Vienna +ENV TZ=Europe/Vienna - RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && echo $TZ > /etc/timezone \ && dpkg-reconfigure -f noninteractive tzdata RUN apt-get update \ && apt-get -y dist-upgrade \ - && apt-get install -y software-properties-common language-pack-en-base language-pack-de git \ + && apt-get install -y software-properties-common language-pack-en-base language-pack-de git unzip \ && LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php \ && apt-get update \ && echo "Package: *\nPin: release o=LP-PPA-ondrej-php5\nPin-Priority: 1001" > /etc/apt/preferences.d/ondrej \ - && apt-get install -y php5.6-fpm php5.6-sqlite3 php5.6-pgsql php5.6-mysql php5.6-mcrypt php5.6-mbstring php5.6-intl php5.6-gd php5.6-curl php5.6-xml php5.6-xsl php5.6-xdebug php5.6-zip \ + && apt-get install -y php5.6-fpm php5.6-sqlite3 php5.6-pgsql php5.6-mysql php5.6-mbstring php5.6-intl php5.6-gd php5.6-curl php5.6-xml php5.6-xsl php5.6-xdebug php5.6-zip php5.6-mcrypt \ && apt-get install -y php-pear \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN phpenmod -v 5.6 -s ALL sqlite3 pgsql mysql mcrypt mbstring intl gd curl xml xsl xdebug zip +RUN phpenmod -v 5.6 -s ALL sqlite3 pgsql mysql mbstring intl gd curl xml xsl xdebug zip mcrypt # supply but disable xdebug; can be enabled by custom volume-mount ini file RUN phpdismod -v 5.6 -s ALL xdebug @@ -30,11 +30,9 @@ RUN phpdismod -v 5.6 -s ALL xdebug RUN php5.6 -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \ && php5.6 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php +RUN composer global require hirak/prestissimo -# install phing -RUN export PHP_PEAR_PHP_BIN=php5.6 \ - && pear channel-discover pear.phing.info \ - && pear install phing/phing +ENV PATH="${PATH}:/root/.composer/vendor/bin" # Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> 5.6/fpm/Dockerfile COPY php-fpm.conf /etc/php/5.6/fpm/php-fpm.conf diff --git a/7.0/fpm/Dockerfile b/7.0/fpm/Dockerfile index 99bfb41..7fa7916 100644 --- a/7.0/fpm/Dockerfile +++ b/7.0/fpm/Dockerfile @@ -4,24 +4,24 @@ MAINTAINER 25th-floor GmbH EXPOSE 9000 ENV DEBIAN_FRONTEND noninteractive - ENV TZ=Europe/Vienna +ENV TZ=Europe/Vienna - RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && echo $TZ > /etc/timezone \ && dpkg-reconfigure -f noninteractive tzdata RUN apt-get update \ && apt-get -y dist-upgrade \ - && apt-get install -y software-properties-common language-pack-en-base language-pack-de git \ + && apt-get install -y software-properties-common language-pack-en-base language-pack-de git unzip \ && LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php \ && apt-get update \ && echo "Package: *\nPin: release o=LP-PPA-ondrej-php5\nPin-Priority: 1001" > /etc/apt/preferences.d/ondrej \ - && apt-get install -y php7.0-fpm php7.0-sqlite3 php7.0-pgsql php7.0-mysql php7.0-mcrypt php7.0-mbstring php7.0-intl php7.0-gd php7.0-curl php7.0-xml php7.0-xsl php7.0-xdebug php7.0-zip \ + && apt-get install -y php7.0-fpm php7.0-sqlite3 php7.0-pgsql php7.0-mysql php7.0-mbstring php7.0-intl php7.0-gd php7.0-curl php7.0-xml php7.0-xsl php7.0-xdebug php7.0-zip php7.0-mcrypt \ && apt-get install -y php-pear \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN phpenmod -v 7.0 -s ALL sqlite3 pgsql mysql mcrypt mbstring intl gd curl xml xsl xdebug zip +RUN phpenmod -v 7.0 -s ALL sqlite3 pgsql mysql mbstring intl gd curl xml xsl xdebug zip mcrypt # supply but disable xdebug; can be enabled by custom volume-mount ini file RUN phpdismod -v 7.0 -s ALL xdebug @@ -30,11 +30,9 @@ RUN phpdismod -v 7.0 -s ALL xdebug RUN php7.0 -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \ && php7.0 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php +RUN composer global require hirak/prestissimo -# install phing -RUN export PHP_PEAR_PHP_BIN=php7.0 \ - && pear channel-discover pear.phing.info \ - && pear install phing/phing +ENV PATH="${PATH}:/root/.composer/vendor/bin" # Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> 7.0/fpm/Dockerfile COPY php-fpm.conf /etc/php/7.0/fpm/php-fpm.conf diff --git a/7.1/fpm/Dockerfile b/7.1/fpm/Dockerfile index 58730e0..fcbf2cc 100644 --- a/7.1/fpm/Dockerfile +++ b/7.1/fpm/Dockerfile @@ -4,9 +4,9 @@ MAINTAINER 25th-floor GmbH EXPOSE 9000 ENV DEBIAN_FRONTEND noninteractive - ENV TZ=Europe/Vienna +ENV TZ=Europe/Vienna - RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && echo $TZ > /etc/timezone \ && dpkg-reconfigure -f noninteractive tzdata @@ -30,13 +30,9 @@ RUN phpdismod -v 7.1 -s ALL xdebug RUN php7.1 -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \ && php7.1 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php +RUN composer global require hirak/prestissimo -ENV PATH="/home/mbandion/.nvm/versions/node/v10.12.0/bin:/home/mbandion/.local/bin:/home/mbandion/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mbandion/.antigen/bundles/zsh-users/zsh-syntax-highlighting:/home/mbandion/.antigen/bundles/zsh-users/zsh-history-substring-search:/home/mbandion/.antigen/bundles/zsh-users/zsh-autosuggestions:/home/mbandion/.antigen/bundles/arzzen/calc.plugin.zsh:~/bin:~/Applications:/root/.composer/vendor/bin" - -# install phing -RUN export PHP_PEAR_PHP_BIN=php7.1 \ - && pear channel-discover pear.phing.info \ - && pear install phing/phing +ENV PATH="${PATH}:/root/.composer/vendor/bin" # Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> 7.1/fpm/Dockerfile COPY php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf diff --git a/7.2/fpm/Dockerfile b/7.2/fpm/Dockerfile index 9ebc724..6d66489 100644 --- a/7.2/fpm/Dockerfile +++ b/7.2/fpm/Dockerfile @@ -4,37 +4,35 @@ MAINTAINER 25th-floor GmbH EXPOSE 9000 ENV DEBIAN_FRONTEND noninteractive - ENV TZ=Europe/Vienna +ENV TZ=Europe/Vienna - RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ -&& echo $TZ > /etc/timezone \ -&& dpkg-reconfigure -f noninteractive tzdata +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ + && echo $TZ > /etc/timezone \ + && dpkg-reconfigure -f noninteractive tzdata RUN apt-get update \ -&& apt-get -y dist-upgrade \ -&& apt-get install -y software-properties-common language-pack-en-base language-pack-de git \ -&& LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php \ -&& apt-get update \ -&& echo "Package: *\nPin: release o=LP-PPA-ondrej-php5\nPin-Priority: 1001" > /etc/apt/preferences.d/ondrej \ -&& apt-get install -y php7.2-fpm php7.2-sqlite3 php7.2-pgsql php7.2-mysql php7.2-mbstring php7.2-intl php7.2-gd php7.2-curl php7.2-xml php7.2-xsl php7.2-xdebug php7.2-zip \ -&& apt-get install -y php-pear \ -&& apt-get clean \ -&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -RUN phpenmod -v 7.2 -s ALL sqlite3 pgsql mysql mcrypt mbstring intl gd curl xml xsl xdebug zip + && apt-get -y dist-upgrade \ + && apt-get install -y software-properties-common language-pack-en-base language-pack-de git unzip \ + && LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php \ + && apt-get update \ + && echo "Package: *\nPin: release o=LP-PPA-ondrej-php5\nPin-Priority: 1001" > /etc/apt/preferences.d/ondrej \ + && apt-get install -y php7.2-fpm php7.2-sqlite3 php7.2-pgsql php7.2-mysql php7.2-mbstring php7.2-intl php7.2-gd php7.2-curl php7.2-xml php7.2-xsl php7.2-xdebug php7.2-zip \ + && apt-get install -y php-pear \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN phpenmod -v 7.2 -s ALL sqlite3 pgsql mysql mbstring intl gd curl xml xsl xdebug zip # supply but disable xdebug; can be enabled by custom volume-mount ini file RUN phpdismod -v 7.2 -s ALL xdebug # install composer RUN php7.2 -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \ -&& php7.2 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ -&& rm composer-setup.php + && php7.2 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ + && rm composer-setup.php +RUN composer global require hirak/prestissimo -# install phing -RUN export PHP_PEAR_PHP_BIN=php7.2 \ -&& pear channel-discover pear.phing.info \ -&& pear install phing/phing +ENV PATH="${PATH}:/root/.composer/vendor/bin" # Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> 7.2/fpm/Dockerfile COPY php-fpm.conf /etc/php/7.2/fpm/php-fpm.conf diff --git a/7.3/fpm/Dockerfile b/7.3/fpm/Dockerfile index 61e573e..e2efbcd 100644 --- a/7.3/fpm/Dockerfile +++ b/7.3/fpm/Dockerfile @@ -4,9 +4,9 @@ MAINTAINER 25th-floor GmbH EXPOSE 9000 ENV DEBIAN_FRONTEND noninteractive - ENV TZ=Europe/Vienna +ENV TZ=Europe/Vienna - RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && echo $TZ > /etc/timezone \ && dpkg-reconfigure -f noninteractive tzdata @@ -30,11 +30,9 @@ RUN phpdismod -v 7.3 -s ALL xdebug RUN php7.3 -r 'readfile("https://getcomposer.org/installer");' > composer-setup.php \ && php7.3 composer-setup.php --install-dir=/usr/local/bin --filename=composer \ && rm composer-setup.php +RUN composer global require hirak/prestissimo -ENV PATH="/home/mbandion/.nvm/versions/node/v10.12.0/bin:/home/mbandion/.local/bin:/home/mbandion/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mbandion/.antigen/bundles/zsh-users/zsh-syntax-highlighting:/home/mbandion/.antigen/bundles/zsh-users/zsh-history-substring-search:/home/mbandion/.antigen/bundles/zsh-users/zsh-autosuggestions:/home/mbandion/.antigen/bundles/arzzen/calc.plugin.zsh:~/bin:~/Applications:/root/.composer/vendor/bin" - -# install phing -RUN composer global require phing/phing +ENV PATH="${PATH}:/root/.composer/vendor/bin" # Prepare run directory\nRUN mkdir /run/php\n\nWORKDIR /var/www\n\n" >> 7.3/fpm/Dockerfile COPY php-fpm.conf /etc/php/7.3/fpm/php-fpm.conf diff --git a/7.3/nginx/Dockerfile b/7.3/nginx/Dockerfile index 48c9d36..da7a6db 100644 --- a/7.3/nginx/Dockerfile +++ b/7.3/nginx/Dockerfile @@ -19,6 +19,6 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && ln -sf /dev/stderr /var/log/nginx/error.log COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf -COPY nginx-site.conf /etc/nginx/conf.d/default.conf +COPY nginx-site.conf /etc/nginx/conf.d/zzz-fpm.conf CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] From 6eb94b0d1ca5ac8f4c4d487fad95f3114802fa69 Mon Sep 17 00:00:00 2001 From: Markus Bandion Date: Tue, 16 Jul 2019 09:32:55 +0200 Subject: [PATCH 9/9] replacing nginx default.conf --- 7.3/nginx/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7.3/nginx/Dockerfile b/7.3/nginx/Dockerfile index 91ffbc4..f25218a 100644 --- a/7.3/nginx/Dockerfile +++ b/7.3/nginx/Dockerfile @@ -20,6 +20,6 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \ && ln -sf /dev/stderr /var/log/nginx/error.log COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf -COPY nginx-site.conf /etc/nginx/conf.d/zzz-fpm.conf +COPY nginx-site.conf /etc/nginx/conf.d/default.conf CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]