Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions php74/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Created by .ignore support plugin (hsz.mobi)
.idea
151 changes: 151 additions & 0 deletions php74/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
FROM centos:7

# Install base packages.
RUN yum -y install epel-release centos-release-scl yum-plugin-ovl deltarpm && \
yum -y update && \
yum -y install sudo ssh curl less vim-minimal dnsutils openssl

RUN yum-config-manager --enable rhel-server-rhscl-7-rpms

# Download confd.
ENV CONFD_VERSION 0.11.0
RUN curl -L "https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-$CONFD_VERSION-linux-amd64" > /usr/bin/confd && \
chmod +x /usr/bin/confd
ENV CONFD_OPTS '--backend=env --onetime'

RUN yum -y install \
https://rpms.remirepo.net/enterprise/remi-release-7.rpm \
yum -y update

# Add the IUS repository. This is needed for git2.
RUN yum -y install \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
yum -y update

RUN yum -y install \
# Install PHP
php74 \
php74-php-devel \
php74-php-gd \
php74-php-xml \
php74-php-pdo \
php74-php-mysql \
php74-php-mysqlnd \
php74-php-mbstring \
php74-php-fpm \
php74-php-opcache \
php74-php-pecl-memcache \
php74-php-pecl-xdebug \
php74-php-posix \
php74-php-mcrypt \
php74-php-pecl-yaml \
php74-php-pecl-zip \
# Install Ruby
ruby193 \
ruby193-rubygems \
ruby193-ruby-devel \
# Install Miscellaneous Tools
bzip2 \
gcc-c++ \
git224-all \
httpd-tools \
jq \
make \
mariadb \
nmap-ncat \
patch \
postgresql \
pv \
rsync \
sendmail \
unzip \
# Necessary for drush
which \
# Necessary library for phantomjs per https://github.com/ariya/phantomjs/issues/10904
fontconfig \
&& yum clean all

# Ensure ruby193 binaries are in path
ENV PATH /root/.composer/vendor/bin:/opt/rh/ruby193/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# Ensure PHP binaries are in path
RUN ln -sfv /opt/remi/php74/root/usr/bin/* /usr/bin/ && \
ln -sfv /opt/remi/php74/root/usr/sbin/* /usr/sbin/

# Install PHPRedis extension
ENV PHPREDIS_VERSION 3.1.5
RUN curl -L -o /tmp/phpredis.tar.gz "https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz" && \
tar -xzf /tmp/phpredis.tar.gz -C /tmp && \
rm /tmp/phpredis.tar.gz && \
cd "/tmp/phpredis-$PHPREDIS_VERSION" && \
phpize && \
./configure && \
make && \
make install

# Enable other ruby193 SCL config
ENV LD_LIBRARY_PATH /opt/rh/ruby193/root/usr/lib64
ENV PKG_CONFIG_PATH /opt/rh/ruby193/root/usr/lib64/pkgconfig

# Ensure $HOME is set
ENV HOME /root

# Configure Git
# https://git-scm.com/docs/git-config#git-config-corepreloadIndex
RUN git config --global core.preloadindex true

# Install Composer
RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER 1

# Add global composer dependencies.
# Drush for drupal development.
# prestissimo for parallelized composer download operations.
RUN composer global require drush/drush:8.x hirak/prestissimo:^0.3 && \
composer clear-cache

# Install nvm, supported node versions, and default cli modules.
ENV NVM_DIR $HOME/.nvm
ENV NODE_VERSION 4
RUN (curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash) && \
chmod +x $HOME/.nvm/nvm.sh

# Node 4.x (LTS)
RUN source $NVM_DIR/nvm.sh && \
nvm install 4 && \
npm install -g bower grunt-cli gulp-cli && \
npm cache clean
# Node 6.x (stable)
RUN source $NVM_DIR/nvm.sh && \
nvm install 6 && \
npm install -g bower grunt-cli gulp-cli && \
npm cache clean
# Node 8.x (stable)
RUN source $NVM_DIR/nvm.sh && \
nvm install 8 && \
npm install -g bower grunt-cli gulp-cli && \
# npm v5 recommends not clearing caches because of improved consistency.
# This is not an argument that applies to Docker image layer size.
npm cache clean --force
# Set the default version which can be overridden by ENV.
RUN source $NVM_DIR/nvm.sh && nvm alias default $NODE_VERSION && nvm cache clear

# Configure npm for container life.
ENV NPM_CONFIG_UNSAFE_PERM true
# Configure bower for container life.
ENV BOWER_ALLOW_ROOT true

COPY root /

# Install Drush commands
RUN drush pm-download -yv registry_rebuild-7.x --destination=/etc/drush/commands

# Run the s6-based init.
ENTRYPOINT ["/init"]

# Set up a standard volume for logs.
VOLUME ["/var/log/services"]

CMD [ "/versions.sh" ]
6 changes: 6 additions & 0 deletions php74/root/etc/confd/conf.d/startuptime.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[template]
src="startuptime.tmpl"
dest="/var/log/services/README.txt"
keys=[
"/",
]
7 changes: 7 additions & 0 deletions php74/root/etc/confd/conf.d/xdebug.ini.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[template]
src = "xdebug.ini.tmpl"
dest = "/etc/opt/remi/php74/php.d/15-xdebug.ini"
uid = 0
gid = 0
mode = "0644"
keys = []
7 changes: 7 additions & 0 deletions php74/root/etc/confd/conf.d/yaml.ini.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[template]
src = "yaml.ini.tmpl"
dest = "/etc/opt/remi/php74/php.d/40-yaml.ini"
uid = 0
gid = 0
mode = "0644"
keys = []
3 changes: 3 additions & 0 deletions php74/root/etc/confd/templates/startuptime.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This container was started at {{datetime}}.

The logs for various services in the container will be written to this directory.
26 changes: 26 additions & 0 deletions php74/root/etc/confd/templates/xdebug.ini.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
; Enable xdebug extension module
{{ $xdebug := getenv "PHP_XDEBUG" }}
{{ if eq $xdebug "true" }}
zend_extension=xdebug.so
{{ end }}

xdebug.coverage_enable=0
xdebug.default_enable=1

xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
; If the following remote_host value does not work use the environmental
; variable XDEBUG_CONFIG to override it. Documentation for format at
; https://xdebug.org/docs/remote
xdebug.remote_host=192.168.99.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_log=/tmp/xdebug.log

xdebug.idekey="DEVTOOLS"

; Drupal 8 requires this be set to 256.
xdebug.max_nesting_level=256

; see http://xdebug.org/docs/all_settings
27 changes: 27 additions & 0 deletions php74/root/etc/confd/templates/yaml.ini.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
; Enable YAML extension module
{{ $enabled := getenv "PHP_YAML" }}
{{ if eq $enabled "true" }}
extension = yaml.so
{{ end }}

; yaml extension configuration
; see http://www.php.net/manual/en/yaml.configuration.php

; Decode entities which have the explicit tag "tag:yaml.org,2002:binary"
;yaml.decode_binary = 0

; Controls the decoding of "tag:yaml.org,2002:timestamp"
; 0 will not apply any decoding, 1 will use strtotime() 2 will use date_create().
;yaml.decode_timestamp = 0

; Cause canonical form output.
;yaml.output_canonical = 0

; Number of spaces to indent sections. Value should be between 1 and 10.
;yaml.output_indent = 2

; Set the preferred line width. -1 means unlimited.
;yaml.output_width = 80

; Enable/disable serialized php object processing.
;yaml.decode_php = 1
3 changes: 3 additions & 0 deletions php74/root/etc/cont-init.d/30-node-nvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bash
echo "Setting node version to: $NODE_VERSION"
source $HOME/.nvm/nvm.sh && nvm alias default $NODE_VERSION
13 changes: 13 additions & 0 deletions php74/root/etc/drush/drushrc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

// Let drush use unlimited memory.
ini_set('memory_limit', -1);

// Allow Drush to run forever.
ini_set('max_execution_time', -1);

// Look for alias files.
$options['alias-path'] = '/etc/drush';

// Look for command files for auto-include.
$options['include'] = '/etc/drush/commands';
111 changes: 111 additions & 0 deletions php74/root/etc/opt/remi/php74/php.d/10-opcache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
; Enable Zend OPcache extension module
zend_extension=opcache.so

; Determines if Zend OPCache is enabled
opcache.enable=1

; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0

; The OPcache shared memory storage size.
opcache.memory_consumption=256

; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=8

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=4000

; The maximum percentage of "wasted" memory until a restart is scheduled.
;opcache.max_wasted_percentage=5

; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
;opcache.use_cwd=1

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
;opcache.validate_timestamps=1

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
;opcache.revalidate_freq=2

; Enables or disables file search in include_path optimization
;opcache.revalidate_path=0

; If disabled, all PHPDoc comments are dropped from the code to reduce the
; size of the optimized code.
;opcache.save_comments=1

; If enabled, a fast shutdown sequence is used for the accelerated code
opcache.fast_shutdown=1

; Allow file existence override (file_exists, etc.) performance feature.
;opcache.enable_file_override=0

; A bitmask, where each bit enables or disables the appropriate OPcache
; passes
;opcache.optimization_level=0xffffffff

;opcache.inherited_hack=1
;opcache.dups_fix=0

; The location of the OPcache blacklist file (wildcards allowed).
; Each OPcache blacklist file is a text file that holds the names of files
; that should not be accelerated.
opcache.blacklist_filename=/etc/opt/remi/php74/php.d/opcache*.blacklist

; Allows exclusion of large files from being cached. By default all files
; are cached.
;opcache.max_file_size=0

; Check the cache checksum each N requests.
; The default value of "0" means that the checks are disabled.
;opcache.consistency_checks=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180

; OPcache error_log file name. Empty string assumes "stderr".
;opcache.error_log=

; All OPcache errors go to the Web server log.
; By default, only fatal errors (level 0) or errors (level 1) are logged.
; You can also enable warnings (level 2), info messages (level 3) or
; debug messages (level 4).
;opcache.log_verbosity_level=1

; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model=

; Protect the shared memory from unexpected writing during script execution.
; Useful for internal debugging only.
;opcache.protect_memory=0

; Allows calling OPcache API functions only from PHP scripts which path is
; started from specified string. The default "" means no restriction
;opcache.restrict_api=

; Enables and sets the second level cache directory.
; It should improve performance when SHM memory is full, at server restart or
; SHM reset. The default "" disables file based caching.
; RPM note : file cache directory must be owned by process owner
; for mod_php, see /etc/opt/remi/php74/httpd/conf.d/php.conf
; for php-fpm, see /etc/opt/remi/php74/php-fpm.d/*conf
;opcache.file_cache=

; Enables or disables opcode caching in shared memory.
;opcache.file_cache_only=0

; Enables or disables checksum validation when script loaded from file cache.
;opcache.file_cache_consistency_checks=1

; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
; This should improve performance, but requires appropriate OS configuration.
opcache.huge_code_pages=1
1 change: 1 addition & 0 deletions php74/root/etc/opt/remi/php74/php.d/90-redis.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension=redis.so
1 change: 1 addition & 0 deletions php74/root/etc/opt/remi/php74/php.d/buildtimezone.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
date.timezone = America/New_York
Loading