Skip to content

Commit

Permalink
Update php to 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewPattell committed Jan 24, 2020
1 parent b60179a commit ce92a9b
Show file tree
Hide file tree
Showing 19 changed files with 338 additions and 211 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ to the require section of your `composer.json` file.
- NGINX
- matthewpatell/universal-docker-nginx:3.6
- SERVER
- matthewpatell/universal-docker-server:3.9
- matthewpatell/universal-docker-server:3.9-dev
- matthewpatell/universal-docker-server:3.9-jre (with java)
- matthewpatell/universal-docker-server:4.0
- matthewpatell/universal-docker-server:4.0-dev
- matthewpatell/universal-docker-server:4.0-jre (with java)
- PHP-FPM:
- matthewpatell/universal-docker-server-php-fpm:3.8
- matthewpatell/universal-docker-server-php-fpm:4.0

**FEATURES**
---
Expand Down Expand Up @@ -131,13 +131,13 @@ to the require section of your `composer.json` file.
- with server images:

```bash
docker run --rm --interactive --volume $PWD:/app matthewpatell/universal-docker-server:3.8 bash -c 'cd /app && composer install --no-scripts'
docker run --rm --interactive --volume $PWD:/app matthewpatell/universal-docker-server:4.0 bash -c 'cd /app && composer install --no-scripts'
```

- with server image and additional global packages:

```bash
docker run --rm --interactive --volume $PWD:/app matthewpatell/universal-docker-server:3.8 bash -c 'cd /app && composer global require "fxp/composer-asset-plugin:^1.4.2" && composer global require "hirak/prestissimo:~0.3.7" && composer install --no-scripts'
docker run --rm --interactive --volume $PWD:/app matthewpatell/universal-docker-server:4.0 bash -c 'cd /app && composer global require "fxp/composer-asset-plugin:^1.4.2" && composer global require "hirak/prestissimo:~0.3.7" && composer install --no-scripts'
```

- Use git-container instead of git itself
Expand Down
8 changes: 4 additions & 4 deletions docker/.env-default
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ XDEBUG_CONFIG="default_enable=0 remote_host=172.18.0.1 remote_enable=0 profiler_

# IMAGES REPOSITORIES
NGINX_REPOSITORY=matthewpatell/universal-docker-nginx:3.6
SERVER_REPOSITORY=matthewpatell/universal-docker-server:3.9-dev
SERVER_REPOSITORY=matthewpatell/universal-docker-server:4.0-dev

# For production environment:
#SERVER_REPOSITORY=matthewpatell/universal-docker-server:3.9
#SERVER_REPOSITORY=matthewpatell/universal-docker-server:4.0

# For production environment with ngingx+php scaling
#SERVER_REPOSITORY=matthewpatell/universal-docker-server-php-fpm:3.8
#TERMINAL_REPOSITORY=matthewpatell/universal-docker-server:3.9
#SERVER_REPOSITORY=matthewpatell/universal-docker-server-php-fpm:4.0
#TERMINAL_REPOSITORY=matthewpatell/universal-docker-server:4.0

# DOMAINS
#DOMAIN_API=api.sampledomain.com
Expand Down
6 changes: 3 additions & 3 deletions docker/Dockerfile-dev-server
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM matthewpatell/universal-docker-server:3.9
FROM matthewpatell/universal-docker-server:4.0

# RUN apt-get update

RUN apt-get install -y \
php7.1-dev \
php7.1-phpdbg \
php${PHP_VERSION}-dev \
php${PHP_VERSION}-phpdbg \
php-codesniffer

RUN phpenmod xdebug
42 changes: 22 additions & 20 deletions docker/Dockerfile-php-fpm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ MAINTAINER Matthew Patell <lukomi@mail.ru>
# Setup environment
ENV DEBIAN_FRONTEND noninteractive

ENV PHP_VERSION 7.4

RUN apt-get update -y --fix-missing \
# Images utils
&& apt-get install -y libjpeg-progs jpegoptim pngquant librsvg2-2 libfcgi0ldbl \
Expand All @@ -15,38 +17,38 @@ RUN apt-get update -y --fix-missing \
&& apt-get update -y --fix-missing \
# PHP
&& apt-get install -y --allow-unauthenticated \
php7.1 php7.1-fpm php7.1-cgi php7.1-cli php7.1-common \
php7.1-bcmath php7.1-curl php7.1-dba php7.1-enchant \
php7.1-gd php7.1-gmp php-imagick \
php7.1-imap php7.1-interbase \
php7.1-intl php7.1-json php7.1-ldap \
php7.1-mbstring \
php7.1-mysql php7.1-odbc php7.1-pgsql php7.1-sqlite3 \
php7.1-opcache php7.1-pspell php7.1-readline \
php7.1-recode php7.1-snmp php7.1-soap \
php7.1-sybase php7.1-tidy \
php7.1-xml php7.1-xmlrpc php7.1-xsl \
php7.1-zip php7.1-bz2 \
php7.1-dev php7.1-xdebug \
php${PHP_VERSION} php${PHP_VERSION}-fpm php${PHP_VERSION}-cgi php${PHP_VERSION}-cli php${PHP_VERSION}-common \
php${PHP_VERSION}-bcmath php${PHP_VERSION}-curl php${PHP_VERSION}-dba php${PHP_VERSION}-enchant \
php${PHP_VERSION}-gd php${PHP_VERSION}-gmp php-imagick \
php${PHP_VERSION}-imap php${PHP_VERSION}-interbase \
php${PHP_VERSION}-intl php${PHP_VERSION}-json php${PHP_VERSION}-ldap \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql php${PHP_VERSION}-odbc php${PHP_VERSION}-pgsql php${PHP_VERSION}-sqlite3 \
php${PHP_VERSION}-opcache php${PHP_VERSION}-pspell php${PHP_VERSION}-readline \
php${PHP_VERSION}-snmp php${PHP_VERSION}-soap \
php${PHP_VERSION}-sybase php${PHP_VERSION}-tidy \
php${PHP_VERSION}-xml php${PHP_VERSION}-xmlrpc php${PHP_VERSION}-xsl \
php${PHP_VERSION}-zip php${PHP_VERSION}-bz2 \
php${PHP_VERSION}-dev php${PHP_VERSION}-xdebug \
# Pecl extensions
# yaml
&& apt-get install -y libyaml-dev \
&& printf "\n" | pecl install yaml-2.0.0 \
&& echo "extension=yaml.so" >> /etc/php/7.1/mods-available/yaml.ini \
&& printf "\n" | pecl install yaml-2.0.4 \
&& echo "extension=yaml.so" >> /etc/php/${PHP_VERSION}/mods-available/yaml.ini \
&& phpenmod yaml \
# Xdebug default disable
&& phpdismod xdebug \
# Cleaup
&& apt-get remove -y php7.1-dev gnupg \
&& apt-get remove -y php${PHP_VERSION}-dev gnupg \
&& apt-get -y autoremove && apt-get autoclean

# Copy start script
COPY php/php7.1-fpm /etc/init.d/php7.1-fpm
COPY php/php${PHP_VERSION}-fpm /etc/init.d/php${PHP_VERSION}-fpm
# Set correct permission
RUN chmod 0755 /etc/init.d/php7.1-fpm
RUN chmod 0755 /etc/init.d/php${PHP_VERSION}-fpm

RUN update-rc.d php7.1-fpm defaults
RUN update-rc.d php${PHP_VERSION}-fpm defaults

EXPOSE 9000

CMD service php7.1-fpm start && tail -f /var/log/php7.1-fpm/fpm.log
CMD service php${PHP_VERSION}-fpm start && tail -f /var/log/php${PHP_VERSION}-fpm/fpm.log
4 changes: 2 additions & 2 deletions docker/Dockerfile-server
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM matthewpatell/universal-docker-server-php-fpm:3.8
FROM matthewpatell/universal-docker-server-php-fpm:4.0

# Utils
RUN apt-get update -y --fix-missing \
Expand Down Expand Up @@ -37,4 +37,4 @@ RUN apt-get update -y --fix-missing \
&& apt-get install -y supervisor \
&& mkdir -p /var/log/supervisord

CMD service php7.1-fpm start && supervisord -n
CMD service php${PHP_VERSION}-fpm start && supervisord -n
2 changes: 1 addition & 1 deletion docker/Dockerfile-server-jre
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM matthewpatell/universal-docker-server:3.9
FROM matthewpatell/universal-docker-server:4.0

# RUN apt-get update

Expand Down
8 changes: 4 additions & 4 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PHP-fpm docker container with PHP 7.1
# PHP-fpm docker container with PHP 7.4
* Ubuntu 18.04
* PHP 7.1
* PHP 7.4

# PHP docker container with PHP 7.1
# PHP docker container with PHP 7.4
* Extends PHP-fpm image
* SSH
* Certbot
Expand All @@ -15,4 +15,4 @@
* Nginx 1.15.7

# Redis docker container
* Redis 4.0.10
* Redis 4.0.10
14 changes: 7 additions & 7 deletions docker/docker-compose.php-fpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ services:
- ${PACKAGE_DOCKER_FOLDER}/pam/pam.d/cron:/etc/pam.d/cron
- ${PROJECT_DOCKER_FOLDER}/cron/server/logs:/var/log/cron
# php
- ${PACKAGE_DOCKER_FOLDER}/php/php.ini:/etc/php/7.1/cli/php.ini
- ${PACKAGE_DOCKER_FOLDER}/php/php.ini:/etc/php/7.1/fpm/php.ini
- ${PACKAGE_DOCKER_FOLDER}/php/php-fpm.conf:/etc/php/7.1/fpm/php-fpm.conf
- ${PACKAGE_DOCKER_FOLDER}/php/pool.d:/etc/php/7.1/fpm/pool.d/
- ${PACKAGE_DOCKER_FOLDER}/php/mods-available/xdebug.ini:/etc/php/7.1/mods-available/xdebug.ini
- ${PROJECT_DOCKER_FOLDER}/php/logs:/var/log/php7.1-fpm/
- ${PACKAGE_DOCKER_FOLDER}/php/php.ini:/etc/php/7.4/cli/php.ini
- ${PACKAGE_DOCKER_FOLDER}/php/php.ini:/etc/php/7.4/fpm/php.ini
- ${PACKAGE_DOCKER_FOLDER}/php/php-fpm.conf:/etc/php/7.4/fpm/php-fpm.conf
- ${PACKAGE_DOCKER_FOLDER}/php/pool.d:/etc/php/7.4/fpm/pool.d/
- ${PACKAGE_DOCKER_FOLDER}/php/mods-available/xdebug.ini:/etc/php/7.4/mods-available/xdebug.ini
- ${PROJECT_DOCKER_FOLDER}/php/logs:/var/log/php7.4-fpm/
# supervisor
- ${PACKAGE_DOCKER_FOLDER}/supervisord/supervisord.conf:/etc/supervisor/supervisord.conf
- ${PROJECT_DOCKER_FOLDER}/supervisord/server/logs:/var/log/supervisord
Expand All @@ -39,4 +39,4 @@ services:

networks:
common:
driver: bridge
driver: bridge
6 changes: 3 additions & 3 deletions docker/php/mods-available/xdebug.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ xdebug.remote_connect_back = 0
xdebug.idekey = PHPSTORM
xdebug.max_nesting_level = 512
xdebug.file_link_format = phpstorm://open?%f:%l
xdebug.remote_log = /var/log/php7.1-fpm/xdebug_remote.log
xdebug.profiler_output_dir = /var/log/php7.1-fpm/profiling
xdebug.remote_log = /var/log/php7.4-fpm/xdebug_remote.log
xdebug.profiler_output_dir = /var/log/php7.4-fpm/profiling
xdebug.profiler_output_name = cachegrind.out.%p.%R

# set via .env
# xdebug.remote_port = 9009
# xdebug.remote_host = 172.18.0.1
# xdebug.profiler_enable_trigger = 1
# xdebug.profiler_enable_trigger = 1
32 changes: 25 additions & 7 deletions docker/php/php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;;;;;;;;;;;;;;;;;;;;;

; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; prefix (/usr/local). This prefix can be dynamically changed by using the
; '-p' argument from the command line.

;;;;;;;;;;;;;;;;;;
Expand All @@ -12,16 +12,16 @@

[global]
; Pid file
; Note: the default prefix is /var
; Note: the default prefix is /usr/local/var
; Default Value: none
;pid = /run/php/php7.1-fpm.pid
;pid = /run/php/php7.4-fpm.pid

; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; into a local file.
; Note: the default prefix is /var
; Note: the default prefix is /usr/local/var
; Default Value: log/php-fpm.log
error_log = /var/log/php7.1-fpm/fpm.log
error_log = /var/log/php7.4-fpm/fpm.log

; syslog_facility is used to specify what type of program is logging the
; message. This lets syslogd specify that messages from different facilities
Expand All @@ -41,6 +41,24 @@ error_log = /var/log/php7.1-fpm/fpm.log
; Default Value: notice
;log_level = notice

; Log limit on number of characters in the single line (log entry). If the
; line is over the limit, it is wrapped on multiple lines. The limit is for
; all logged characters including message prefix and suffix if present. However
; the new line character does not count into it as it is present only when
; logging to a file descriptor. It means the new line character is not present
; when logging to syslog.
; Default Value: 1024
;log_limit = 4096

; Log buffering specifies if the log line is buffered which means that the
; line is written in a single write operation. If the value is false, then the
; data is written directly into the file descriptor. It is an experimental
; option that can potentionaly improve logging performance and memory usage
; for some heavy logging scenarios. This option is ignored if logging to syslog
; as it has to be always buffered.
; Default value: yes
;log_buffering = no

; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
Expand Down Expand Up @@ -121,5 +139,5 @@ error_log = /var/log/php7.1-fpm/fpm.log
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr otherwise
include=/etc/php/7.1/fpm/pool.d/*.conf
; - /usr/local otherwise
include=/etc/php/7.4/fpm/pool.d/*.conf
Loading

0 comments on commit ce92a9b

Please sign in to comment.