diff --git a/Dockerfiles/base/Dockerfile-5.4 b/Dockerfiles/base/Dockerfile-5.4 index 78ba444..a8fd46e 100644 --- a/Dockerfiles/base/Dockerfile-5.4 +++ b/Dockerfiles/base/Dockerfile-5.4 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. FROM php:5.4-fpm MAINTAINER "cytopia" diff --git a/Dockerfiles/base/Dockerfile-5.5 b/Dockerfiles/base/Dockerfile-5.5 index c6907fb..7b44dbf 100644 --- a/Dockerfiles/base/Dockerfile-5.5 +++ b/Dockerfiles/base/Dockerfile-5.5 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. FROM php:5.5-fpm MAINTAINER "cytopia" diff --git a/Dockerfiles/base/Dockerfile-5.6 b/Dockerfiles/base/Dockerfile-5.6 index dfe0bcd..268618c 100644 --- a/Dockerfiles/base/Dockerfile-5.6 +++ b/Dockerfiles/base/Dockerfile-5.6 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. FROM php:5.6-fpm MAINTAINER "cytopia" diff --git a/Dockerfiles/base/Dockerfile-7.0 b/Dockerfiles/base/Dockerfile-7.0 index c0620fa..ca9c627 100644 --- a/Dockerfiles/base/Dockerfile-7.0 +++ b/Dockerfiles/base/Dockerfile-7.0 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. FROM php:7.0-fpm MAINTAINER "cytopia" diff --git a/Dockerfiles/base/Dockerfile-7.1 b/Dockerfiles/base/Dockerfile-7.1 index 6158367..564e633 100644 --- a/Dockerfiles/base/Dockerfile-7.1 +++ b/Dockerfiles/base/Dockerfile-7.1 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. FROM php:7.1-fpm MAINTAINER "cytopia" diff --git a/Dockerfiles/base/Dockerfile-7.2 b/Dockerfiles/base/Dockerfile-7.2 index c4d39c5..3e71730 100644 --- a/Dockerfiles/base/Dockerfile-7.2 +++ b/Dockerfiles/base/Dockerfile-7.2 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. FROM php:7.2-fpm MAINTAINER "cytopia" diff --git a/Dockerfiles/mods/Dockerfile-5.4 b/Dockerfiles/mods/Dockerfile-5.4 index d801d83..9686740 100644 --- a/Dockerfiles/mods/Dockerfile-5.4 +++ b/Dockerfiles/mods/Dockerfile-5.4 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead. FROM devilbox/php-fpm:5.4-base MAINTAINER "cytopia" diff --git a/Dockerfiles/mods/Dockerfile-5.5 b/Dockerfiles/mods/Dockerfile-5.5 index 76d0a1c..51bdedf 100644 --- a/Dockerfiles/mods/Dockerfile-5.5 +++ b/Dockerfiles/mods/Dockerfile-5.5 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead. FROM devilbox/php-fpm:5.5-base MAINTAINER "cytopia" diff --git a/Dockerfiles/mods/Dockerfile-5.6 b/Dockerfiles/mods/Dockerfile-5.6 index 5509a6b..6396d22 100644 --- a/Dockerfiles/mods/Dockerfile-5.6 +++ b/Dockerfiles/mods/Dockerfile-5.6 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead. FROM devilbox/php-fpm:5.6-base MAINTAINER "cytopia" diff --git a/Dockerfiles/mods/Dockerfile-7.0 b/Dockerfiles/mods/Dockerfile-7.0 index 94b95ff..fa63b3a 100644 --- a/Dockerfiles/mods/Dockerfile-7.0 +++ b/Dockerfiles/mods/Dockerfile-7.0 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead. FROM devilbox/php-fpm:7.0-base MAINTAINER "cytopia" diff --git a/Dockerfiles/mods/Dockerfile-7.1 b/Dockerfiles/mods/Dockerfile-7.1 index fcde385..083f5d5 100644 --- a/Dockerfiles/mods/Dockerfile-7.1 +++ b/Dockerfiles/mods/Dockerfile-7.1 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead. FROM devilbox/php-fpm:7.1-base MAINTAINER "cytopia" diff --git a/Dockerfiles/mods/Dockerfile-7.2 b/Dockerfiles/mods/Dockerfile-7.2 index 09c9d3c..4be8132 100644 --- a/Dockerfiles/mods/Dockerfile-7.2 +++ b/Dockerfiles/mods/Dockerfile-7.2 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead. FROM devilbox/php-fpm:7.2-base MAINTAINER "cytopia" diff --git a/Dockerfiles/prod/Dockerfile-5.4 b/Dockerfiles/prod/Dockerfile-5.4 index b9ea0ae..53bad65 100644 --- a/Dockerfiles/prod/Dockerfile-5.4 +++ b/Dockerfiles/prod/Dockerfile-5.4 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. FROM devilbox/php-fpm:5.4-mods MAINTAINER "cytopia" @@ -35,19 +35,6 @@ RUN set -x \ -### -### Configure -### -RUN set -x \ - && { \ - echo "[mail function]"; \ - echo "sendmail_path = /usr/sbin/sendmail -t -i"; \ - echo ";mail.force_extra_parameters ="; \ - echo "mail.add_x_header = On"; \ - echo "mail.log = /var/log/php/mail.log"; \ - } > /usr/local/etc/php/conf.d/devilbox-mail.ini - - ### ### Verify ### diff --git a/Dockerfiles/prod/Dockerfile-5.5 b/Dockerfiles/prod/Dockerfile-5.5 index 6d046c9..530b615 100644 --- a/Dockerfiles/prod/Dockerfile-5.5 +++ b/Dockerfiles/prod/Dockerfile-5.5 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. FROM devilbox/php-fpm:5.5-mods MAINTAINER "cytopia" @@ -35,19 +35,6 @@ RUN set -x \ -### -### Configure -### -RUN set -x \ - && { \ - echo "[mail function]"; \ - echo "sendmail_path = /usr/sbin/sendmail -t -i"; \ - echo ";mail.force_extra_parameters ="; \ - echo "mail.add_x_header = On"; \ - echo "mail.log = /var/log/php/mail.log"; \ - } > /usr/local/etc/php/conf.d/devilbox-mail.ini - - ### ### Verify ### diff --git a/Dockerfiles/prod/Dockerfile-5.6 b/Dockerfiles/prod/Dockerfile-5.6 index 0939ab3..e84ac60 100644 --- a/Dockerfiles/prod/Dockerfile-5.6 +++ b/Dockerfiles/prod/Dockerfile-5.6 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. FROM devilbox/php-fpm:5.6-mods MAINTAINER "cytopia" @@ -35,19 +35,6 @@ RUN set -x \ -### -### Configure -### -RUN set -x \ - && { \ - echo "[mail function]"; \ - echo "sendmail_path = /usr/sbin/sendmail -t -i"; \ - echo ";mail.force_extra_parameters ="; \ - echo "mail.add_x_header = On"; \ - echo "mail.log = /var/log/php/mail.log"; \ - } > /usr/local/etc/php/conf.d/devilbox-mail.ini - - ### ### Verify ### diff --git a/Dockerfiles/prod/Dockerfile-7.0 b/Dockerfiles/prod/Dockerfile-7.0 index f588959..6992be6 100644 --- a/Dockerfiles/prod/Dockerfile-7.0 +++ b/Dockerfiles/prod/Dockerfile-7.0 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. FROM devilbox/php-fpm:7.0-mods MAINTAINER "cytopia" @@ -35,19 +35,6 @@ RUN set -x \ -### -### Configure -### -RUN set -x \ - && { \ - echo "[mail function]"; \ - echo "sendmail_path = /usr/sbin/sendmail -t -i"; \ - echo ";mail.force_extra_parameters ="; \ - echo "mail.add_x_header = On"; \ - echo "mail.log = /var/log/php/mail.log"; \ - } > /usr/local/etc/php/conf.d/devilbox-mail.ini - - ### ### Verify ### diff --git a/Dockerfiles/prod/Dockerfile-7.1 b/Dockerfiles/prod/Dockerfile-7.1 index 552f057..e44ca40 100644 --- a/Dockerfiles/prod/Dockerfile-7.1 +++ b/Dockerfiles/prod/Dockerfile-7.1 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. FROM devilbox/php-fpm:7.1-mods MAINTAINER "cytopia" @@ -35,19 +35,6 @@ RUN set -x \ -### -### Configure -### -RUN set -x \ - && { \ - echo "[mail function]"; \ - echo "sendmail_path = /usr/sbin/sendmail -t -i"; \ - echo ";mail.force_extra_parameters ="; \ - echo "mail.add_x_header = On"; \ - echo "mail.log = /var/log/php/mail.log"; \ - } > /usr/local/etc/php/conf.d/devilbox-mail.ini - - ### ### Verify ### diff --git a/Dockerfiles/prod/Dockerfile-7.2 b/Dockerfiles/prod/Dockerfile-7.2 index 0b14c07..40f6f2c 100644 --- a/Dockerfiles/prod/Dockerfile-7.2 +++ b/Dockerfiles/prod/Dockerfile-7.2 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. FROM devilbox/php-fpm:7.2-mods MAINTAINER "cytopia" @@ -35,19 +35,6 @@ RUN set -x \ -### -### Configure -### -RUN set -x \ - && { \ - echo "[mail function]"; \ - echo "sendmail_path = /usr/sbin/sendmail -t -i"; \ - echo ";mail.force_extra_parameters ="; \ - echo "mail.add_x_header = On"; \ - echo "mail.log = /var/log/php/mail.log"; \ - } > /usr/local/etc/php/conf.d/devilbox-mail.ini - - ### ### Verify ### diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/30-timezone.sh b/Dockerfiles/prod/data/docker-entrypoint.d/30-timezone.sh index 03a03bb..ebc0632 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.d/30-timezone.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.d/30-timezone.sh @@ -14,9 +14,10 @@ set -o pipefail ### set_timezone() { local env_varname="${1}" - local php_conf_dir="${2}" + local php_ini_dir="${2}" local debug="${3}" local timezone= + local php_ini_file="${php_ini_dir}/devilbox-runtime-timezone.ini" if ! env_set "${env_varname}"; then log "info" "\$${env_varname} not set." "${debug}" @@ -25,7 +26,7 @@ set_timezone() { run "ln -sf /usr/share/zoneinfo/UTC /etc/localtime" "${debug}" # PHP Time log "info" "Setting PHP: timezone=UTC" "${debug}" - run "echo 'date.timezone = UTC' > ${php_conf_dir}/devilbox-runtime.ini" "${debug}" + run "echo 'date.timezone = UTC' > ${php_ini_file}" "${debug}" else timezone="$( env_get "${env_varname}" )" if [ -f "/usr/share/zoneinfo/${timezone}" ]; then @@ -34,7 +35,7 @@ set_timezone() { run "ln -sf /usr/share/zoneinfo/${timezone} /etc/localtime" "${debug}" # PHP Time log "info" "Setting PHP: timezone=${timezone}" "${debug}" - run "echo 'date.timezone = ${timezone}' > ${php_conf_dir}/devilbox-runtime.ini" "${debug}" + run "echo 'date.timezone = ${timezone}' > ${php_ini_file}" "${debug}" else log "err" "Invalid timezone for \$${env_varname}." "${debug}" log "err" "Timezone '${timezone}' does not exist." "${debug}" diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/31-postfix.sh b/Dockerfiles/prod/data/docker-entrypoint.d/31-postfix.sh index f4d2b18..10a21e0 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.d/31-postfix.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.d/31-postfix.sh @@ -16,18 +16,30 @@ set_postfix() { local env_varname="${1}" local username="${2}" local groupname="${3}" - local debug="${4}" + local php_ini_dir="${4}" + local debug="${5}" + local php_ini_file="${php_ini_dir}/devilbox-runtime-sendmail.ini" local catch_all= if ! env_set "${env_varname}"; then log "info" "\$${env_varname} not set." "${debug}" log "info" "Postfix will not be started." "${debug}" + echo "" > "${php_ini_file}" else catch_all="$( env_get "${env_varname}" )" if [ "${catch_all}" = "1" ]; then log "info" "Enabling postfix catch-all" "${debug}" + # Configure PHP + { + echo "[mail function]"; + echo "sendmail_path = $( which sendmail ) -t -i"; + echo ";mail.force_extra_parameters ="; + echo "mail.add_x_header = On"; + echo "mail.log = /var/log/php/mail.log"; + } > "${php_ini_file}" + # Add Mail dir/file if it does not exist if [ ! -d "/var/mail" ]; then run "mkdir /var/mail" "${debug}" @@ -64,6 +76,10 @@ set_postfix() { # Sanity Checks ############################################################ +if ! command -v sendmail >/dev/null 2>&1; then + log "err" "sendmail not found, but required." "1" + exit 1 +fi if ! command -v postconf >/dev/null 2>&1; then log "err" "postconf not found, but required." "1" exit 1 diff --git a/Dockerfiles/prod/data/docker-entrypoint.sh b/Dockerfiles/prod/data/docker-entrypoint.sh index 43a8e01..e4adcae 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.sh @@ -72,7 +72,7 @@ set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### ### Setup postfix ### -set_postfix "ENABLE_MAIL" "${MY_USER}" "${MY_GROUP}" "${DEBUG_LEVEL}" +set_postfix "ENABLE_MAIL" "${MY_USER}" "${MY_GROUP}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### diff --git a/Dockerfiles/work/Dockerfile-5.4 b/Dockerfiles/work/Dockerfile-5.4 index b22dc6d..65be4d3 100644 --- a/Dockerfiles/work/Dockerfile-5.4 +++ b/Dockerfiles/work/Dockerfile-5.4 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead. FROM devilbox/php-fpm:5.4-prod MAINTAINER "cytopia" @@ -15,7 +15,7 @@ LABEL \ ### -### Envs (Already set in parent container) +### Envs ### ENV BASH_PROFILE=".bashrc" @@ -23,9 +23,20 @@ ENV BASH_PROFILE=".bashrc" ### ### Install Tools ### - -# System dev tools RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + dirmngr \ + gnupg \ + && echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A1715D88E1DF1F24 \ + && echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu wily main" > /etc/apt/sources.list.d/git.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \ + && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" > /etc/apt/sources.list.d/mongo.list \ + && curl -q "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 2>/dev/null | apt-key add - \ + && echo "deb http://deb.nodesource.com/node_8.x jessie main" > /etc/apt/sources.list.d/node.list \ + && curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc 2>/dev/null | apt-key add - \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \ && apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ ack-grep \ @@ -49,14 +60,15 @@ RUN set -x \ less \ libc-dev \ make \ -# mongo-tools \ - mongodb-clients \ + mongodb-org-shell \ + mongodb-org-tools \ moreutils \ mysql-client \ nano \ net-tools \ netcat \ -# postgresql-client \ + nodejs \ + postgresql-client \ python-pip \ rubygems \ ruby-dev \ @@ -73,33 +85,64 @@ RUN set -x \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ && rm -rf /var/lib/apt/lists/* -## Node / NPM -#RUN set -x \ -# && mkdir -p /usr/local/src \ -# && VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" \ -# && wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=30 \ -# -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz \ -# && unxz /usr/local/src/node-${VERSION}-linux-x64.tar.xz \ -# && tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar -C /usr/local/src \ -# && ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \ -# && ln -s /usr/local/node/bin/* /usr/local/bin/ \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64.tar* \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/LICENSE \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/*.md \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \ -# && npm --version | grep -E '[.0-9]+' \ -# && node --version | grep -E '[.0-9]+' \ -# && rm -rf /root/.config -# -## Composer -#RUN set -x \ -# && curl -sS https://getcomposer.org/installer | php \ -# && mv composer.phar /usr/local/bin/composer \ -# && composer self-update -## && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' \ -## && rm -rf /root/.composer -# + +# composer +RUN set -x true \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && true +# drush +RUN set -x true \ + && git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ +&& cd /usr/local/src/drush \ +&& git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | sed 's/^.*tags\///g' | grep ^8 | tail -1) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \ +&& ln -s /usr/local/src/drush/drush /usr/local/bin/drush \ +&& rm -rf /usr/local/src/drush/.git \ +&& rm -rf /usr/local/src/drush/docs \ +&& rm -rf /usr/local/src/drush/examples \ +&& rm -rf /usr/local/src/drush/misc \ +&& rm -rf /usr/local/src/drush/tests \ +&& rm -rf /home/${MY_USER}/.composer \ + \ + && true +# wpcli +RUN set -x true \ + && curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -L -o /usr/local/bin/wp \ + && chmod +x /usr/local/bin/wp \ + && true +# symfony +RUN set -x true \ + && curl https://symfony.com/installer -L -o /usr/local/bin/symfony \ + && chmod +x /usr/local/bin/symfony \ + && true +# laravel +RUN set -x true \ + && git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ +&& cd /usr/local/src/laravel-installer \ +&& git checkout v1.3.7 \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \ +&& ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \ +&& rm -rf /usr/local/src/laravel-installer/laravel/.git \ + \ + && true +# phalcon +RUN set -x true \ + && git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ +&& cd /usr/local/src/phalcon-devtools \ +&& git checkout v2.0.9 \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/phalcon-devtools \ +&& su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \ +&& ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \ +&& cd / \ +&& rm -rf /usr/local/src/phalcon-devtools/.git \ + \ + && true + ## Drush #RUN set -x \ # && DRUSH_VERSION="$( curl -q https://api.github.com/repos/drush-ops/drush/releases 2>/dev/null | grep tag_name | grep -Eo '\"[0-9.]+\"' | head -1 | sed 's/\"//g' )" \ @@ -278,6 +321,15 @@ RUN set -x \ && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi +RUN set -x \ + && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' && rm -rf /root/.composer \ + && drush --version | grep -E '[.0-9]+' && rm -rf /root/.drush \ + && wp --allow-root --version | grep -E '[.0-9]+' \ + && symfony --version | grep -E 'version\s*[.0-9]+' \ + && laravel --version | grep -E '(Installer|version)\s*[.0-9]+' \ + && phalcon commands | grep -E '[.0-9]+' \ + && true + ### ### Copy files diff --git a/Dockerfiles/work/Dockerfile-5.5 b/Dockerfiles/work/Dockerfile-5.5 index f9dc427..d3f8514 100644 --- a/Dockerfiles/work/Dockerfile-5.5 +++ b/Dockerfiles/work/Dockerfile-5.5 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead. FROM devilbox/php-fpm:5.5-prod MAINTAINER "cytopia" @@ -15,7 +15,7 @@ LABEL \ ### -### Envs (Already set in parent container) +### Envs ### ENV BASH_PROFILE=".bashrc" @@ -23,9 +23,20 @@ ENV BASH_PROFILE=".bashrc" ### ### Install Tools ### - -# System dev tools RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + dirmngr \ + gnupg \ + && echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A1715D88E1DF1F24 \ + && echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu wily main" > /etc/apt/sources.list.d/git.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \ + && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" > /etc/apt/sources.list.d/mongo.list \ + && curl -q "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 2>/dev/null | apt-key add - \ + && echo "deb http://deb.nodesource.com/node_8.x jessie main" > /etc/apt/sources.list.d/node.list \ + && curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc 2>/dev/null | apt-key add - \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \ && apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ ack-grep \ @@ -49,14 +60,15 @@ RUN set -x \ less \ libc-dev \ make \ -# mongo-tools \ - mongodb-clients \ + mongodb-org-shell \ + mongodb-org-tools \ moreutils \ mysql-client \ nano \ net-tools \ netcat \ -# postgresql-client \ + nodejs \ + postgresql-client \ python-pip \ rubygems \ ruby-dev \ @@ -73,33 +85,69 @@ RUN set -x \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ && rm -rf /var/lib/apt/lists/* -## Node / NPM -#RUN set -x \ -# && mkdir -p /usr/local/src \ -# && VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" \ -# && wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=30 \ -# -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz \ -# && unxz /usr/local/src/node-${VERSION}-linux-x64.tar.xz \ -# && tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar -C /usr/local/src \ -# && ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \ -# && ln -s /usr/local/node/bin/* /usr/local/bin/ \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64.tar* \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/LICENSE \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/*.md \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \ -# && npm --version | grep -E '[.0-9]+' \ -# && node --version | grep -E '[.0-9]+' \ -# && rm -rf /root/.config -# -## Composer -#RUN set -x \ -# && curl -sS https://getcomposer.org/installer | php \ -# && mv composer.phar /usr/local/bin/composer \ -# && composer self-update -## && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' \ -## && rm -rf /root/.composer -# + +# composer +RUN set -x true \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && true +# drush +RUN set -x true \ + && git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ +&& cd /usr/local/src/drush \ +&& git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | sed 's/^.*tags\///g' | grep ^8 | tail -1) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \ +&& ln -s /usr/local/src/drush/drush /usr/local/bin/drush \ +&& rm -rf /usr/local/src/drush/.git \ +&& rm -rf /usr/local/src/drush/docs \ +&& rm -rf /usr/local/src/drush/examples \ +&& rm -rf /usr/local/src/drush/misc \ +&& rm -rf /usr/local/src/drush/tests \ +&& rm -rf /home/${MY_USER}/.composer \ + \ + && true +# drupalconsole +RUN set -x true \ + && curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal \ + && chmod +x /usr/local/bin/drupal \ + && true +# wpcli +RUN set -x true \ + && curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -L -o /usr/local/bin/wp \ + && chmod +x /usr/local/bin/wp \ + && true +# symfony +RUN set -x true \ + && curl https://symfony.com/installer -L -o /usr/local/bin/symfony \ + && chmod +x /usr/local/bin/symfony \ + && true +# laravel +RUN set -x true \ + && git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ +&& cd /usr/local/src/laravel-installer \ +&& git checkout v2.0.0 \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \ +&& ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \ +&& rm -rf /usr/local/src/laravel-installer/laravel/.git \ + \ + && true +# phalcon +RUN set -x true \ + && git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ +&& cd /usr/local/src/phalcon-devtools \ +&& git checkout $(git describe --abbrev=0 --tags) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/phalcon-devtools \ +&& su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \ +&& ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \ +&& cd / \ +&& rm -rf /usr/local/src/phalcon-devtools/.git \ + \ + && true + ## Drush #RUN set -x \ # && DRUSH_VERSION="$( curl -q https://api.github.com/repos/drush-ops/drush/releases 2>/dev/null | grep tag_name | grep -Eo '\"[0-9.]+\"' | head -1 | sed 's/\"//g' )" \ @@ -278,6 +326,16 @@ RUN set -x \ && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi +RUN set -x \ + && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' && rm -rf /root/.composer \ + && drush --version | grep -E '[.0-9]+' && rm -rf /root/.drush \ + && drupal --version | grep -E 'Drupal Console Launcher\s*[.0-9]' \ + && wp --allow-root --version | grep -E '[.0-9]+' \ + && symfony --version | grep -E 'version\s*[.0-9]+' \ + && laravel --version | grep -E '(Installer|version)\s*[.0-9]+' \ + && phalcon commands | grep -E '[.0-9]+' \ + && true + ### ### Copy files diff --git a/Dockerfiles/work/Dockerfile-5.6 b/Dockerfiles/work/Dockerfile-5.6 index ccebe55..63561a6 100644 --- a/Dockerfiles/work/Dockerfile-5.6 +++ b/Dockerfiles/work/Dockerfile-5.6 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead. FROM devilbox/php-fpm:5.6-prod MAINTAINER "cytopia" @@ -15,7 +15,7 @@ LABEL \ ### -### Envs (Already set in parent container) +### Envs ### ENV BASH_PROFILE=".bashrc" @@ -23,9 +23,20 @@ ENV BASH_PROFILE=".bashrc" ### ### Install Tools ### - -# System dev tools RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + dirmngr \ + gnupg \ + && echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A1715D88E1DF1F24 \ + && echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu wily main" > /etc/apt/sources.list.d/git.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \ + && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" > /etc/apt/sources.list.d/mongo.list \ + && curl -q "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 2>/dev/null | apt-key add - \ + && echo "deb http://deb.nodesource.com/node_8.x jessie main" > /etc/apt/sources.list.d/node.list \ + && curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc 2>/dev/null | apt-key add - \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \ && apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ ack-grep \ @@ -49,14 +60,15 @@ RUN set -x \ less \ libc-dev \ make \ -# mongo-tools \ - mongodb-clients \ + mongodb-org-shell \ + mongodb-org-tools \ moreutils \ mysql-client \ nano \ net-tools \ netcat \ -# postgresql-client \ + nodejs \ + postgresql-client \ python-pip \ rubygems \ ruby-dev \ @@ -73,33 +85,69 @@ RUN set -x \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ && rm -rf /var/lib/apt/lists/* -## Node / NPM -#RUN set -x \ -# && mkdir -p /usr/local/src \ -# && VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" \ -# && wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=30 \ -# -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz \ -# && unxz /usr/local/src/node-${VERSION}-linux-x64.tar.xz \ -# && tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar -C /usr/local/src \ -# && ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \ -# && ln -s /usr/local/node/bin/* /usr/local/bin/ \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64.tar* \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/LICENSE \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/*.md \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \ -# && npm --version | grep -E '[.0-9]+' \ -# && node --version | grep -E '[.0-9]+' \ -# && rm -rf /root/.config -# -## Composer -#RUN set -x \ -# && curl -sS https://getcomposer.org/installer | php \ -# && mv composer.phar /usr/local/bin/composer \ -# && composer self-update -## && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' \ -## && rm -rf /root/.composer -# + +# composer +RUN set -x true \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && true +# drush +RUN set -x true \ + && git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ +&& cd /usr/local/src/drush \ +&& git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | tail -1 | sed 's/^.*tags\///g') \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \ +&& ln -s /usr/local/src/drush/drush /usr/local/bin/drush \ +&& rm -rf /usr/local/src/drush/.git \ +&& rm -rf /usr/local/src/drush/docs \ +&& rm -rf /usr/local/src/drush/examples \ +&& rm -rf /usr/local/src/drush/misc \ +&& rm -rf /usr/local/src/drush/tests \ +&& rm -rf /home/${MY_USER}/.composer \ + \ + && true +# drupalconsole +RUN set -x true \ + && curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal \ + && chmod +x /usr/local/bin/drupal \ + && true +# wpcli +RUN set -x true \ + && curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -L -o /usr/local/bin/wp \ + && chmod +x /usr/local/bin/wp \ + && true +# symfony +RUN set -x true \ + && curl https://symfony.com/installer -L -o /usr/local/bin/symfony \ + && chmod +x /usr/local/bin/symfony \ + && true +# laravel +RUN set -x true \ + && git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ +&& cd /usr/local/src/laravel-installer \ +&& git checkout v2.0.0 \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \ +&& ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \ +&& rm -rf /usr/local/src/laravel-installer/laravel/.git \ + \ + && true +# phalcon +RUN set -x true \ + && git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ +&& cd /usr/local/src/phalcon-devtools \ +&& git checkout $(git describe --abbrev=0 --tags) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/phalcon-devtools \ +&& su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \ +&& ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \ +&& cd / \ +&& rm -rf /usr/local/src/phalcon-devtools/.git \ + \ + && true + ## Drush #RUN set -x \ # && DRUSH_VERSION="$( curl -q https://api.github.com/repos/drush-ops/drush/releases 2>/dev/null | grep tag_name | grep -Eo '\"[0-9.]+\"' | head -1 | sed 's/\"//g' )" \ @@ -278,6 +326,16 @@ RUN set -x \ && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi +RUN set -x \ + && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' && rm -rf /root/.composer \ + && drush --version | grep -E '[.0-9]+' && rm -rf /root/.drush \ + && drupal --version | grep -E 'Drupal Console Launcher\s*[.0-9]' \ + && wp --allow-root --version | grep -E '[.0-9]+' \ + && symfony --version | grep -E 'version\s*[.0-9]+' \ + && laravel --version | grep -E '(Installer|version)\s*[.0-9]+' \ + && phalcon commands | grep -E '[.0-9]+' \ + && true + ### ### Copy files diff --git a/Dockerfiles/work/Dockerfile-7.0 b/Dockerfiles/work/Dockerfile-7.0 index 168d42d..c3919ab 100644 --- a/Dockerfiles/work/Dockerfile-7.0 +++ b/Dockerfiles/work/Dockerfile-7.0 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead. FROM devilbox/php-fpm:7.0-prod MAINTAINER "cytopia" @@ -15,7 +15,7 @@ LABEL \ ### -### Envs (Already set in parent container) +### Envs ### ENV BASH_PROFILE=".bashrc" @@ -23,9 +23,20 @@ ENV BASH_PROFILE=".bashrc" ### ### Install Tools ### - -# System dev tools RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + dirmngr \ + gnupg \ + && echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A1715D88E1DF1F24 \ + && echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu wily main" > /etc/apt/sources.list.d/git.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \ + && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" > /etc/apt/sources.list.d/mongo.list \ + && curl -q "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 2>/dev/null | apt-key add - \ + && echo "deb http://deb.nodesource.com/node_8.x jessie main" > /etc/apt/sources.list.d/node.list \ + && curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc 2>/dev/null | apt-key add - \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \ && apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ ack-grep \ @@ -49,14 +60,15 @@ RUN set -x \ less \ libc-dev \ make \ -# mongo-tools \ - mongodb-clients \ + mongodb-org-shell \ + mongodb-org-tools \ moreutils \ mysql-client \ nano \ net-tools \ netcat \ -# postgresql-client \ + nodejs \ + postgresql-client \ python-pip \ rubygems \ ruby-dev \ @@ -73,33 +85,69 @@ RUN set -x \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ && rm -rf /var/lib/apt/lists/* -## Node / NPM -#RUN set -x \ -# && mkdir -p /usr/local/src \ -# && VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" \ -# && wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=30 \ -# -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz \ -# && unxz /usr/local/src/node-${VERSION}-linux-x64.tar.xz \ -# && tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar -C /usr/local/src \ -# && ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \ -# && ln -s /usr/local/node/bin/* /usr/local/bin/ \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64.tar* \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/LICENSE \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/*.md \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \ -# && npm --version | grep -E '[.0-9]+' \ -# && node --version | grep -E '[.0-9]+' \ -# && rm -rf /root/.config -# -## Composer -#RUN set -x \ -# && curl -sS https://getcomposer.org/installer | php \ -# && mv composer.phar /usr/local/bin/composer \ -# && composer self-update -## && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' \ -## && rm -rf /root/.composer -# + +# composer +RUN set -x true \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && true +# drush +RUN set -x true \ + && git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ +&& cd /usr/local/src/drush \ +&& git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | tail -1 | sed 's/^.*tags\///g') \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \ +&& ln -s /usr/local/src/drush/drush /usr/local/bin/drush \ +&& rm -rf /usr/local/src/drush/.git \ +&& rm -rf /usr/local/src/drush/docs \ +&& rm -rf /usr/local/src/drush/examples \ +&& rm -rf /usr/local/src/drush/misc \ +&& rm -rf /usr/local/src/drush/tests \ +&& rm -rf /home/${MY_USER}/.composer \ + \ + && true +# drupalconsole +RUN set -x true \ + && curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal \ + && chmod +x /usr/local/bin/drupal \ + && true +# wpcli +RUN set -x true \ + && curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -L -o /usr/local/bin/wp \ + && chmod +x /usr/local/bin/wp \ + && true +# symfony +RUN set -x true \ + && curl https://symfony.com/installer -L -o /usr/local/bin/symfony \ + && chmod +x /usr/local/bin/symfony \ + && true +# laravel +RUN set -x true \ + && git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ +&& cd /usr/local/src/laravel-installer \ +&& git checkout v2.0.0 \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \ +&& ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \ +&& rm -rf /usr/local/src/laravel-installer/laravel/.git \ + \ + && true +# phalcon +RUN set -x true \ + && git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ +&& cd /usr/local/src/phalcon-devtools \ +&& git checkout $(git describe --abbrev=0 --tags) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/phalcon-devtools \ +&& su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \ +&& ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \ +&& cd / \ +&& rm -rf /usr/local/src/phalcon-devtools/.git \ + \ + && true + ## Drush #RUN set -x \ # && DRUSH_VERSION="$( curl -q https://api.github.com/repos/drush-ops/drush/releases 2>/dev/null | grep tag_name | grep -Eo '\"[0-9.]+\"' | head -1 | sed 's/\"//g' )" \ @@ -278,6 +326,16 @@ RUN set -x \ && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi +RUN set -x \ + && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' && rm -rf /root/.composer \ + && drush --version | grep -E '[.0-9]+' && rm -rf /root/.drush \ + && drupal --version | grep -E 'Drupal Console Launcher\s*[.0-9]' \ + && wp --allow-root --version | grep -E '[.0-9]+' \ + && symfony --version | grep -E 'version\s*[.0-9]+' \ + && laravel --version | grep -E '(Installer|version)\s*[.0-9]+' \ + && phalcon commands | grep -E '[.0-9]+' \ + && true + ### ### Copy files diff --git a/Dockerfiles/work/Dockerfile-7.1 b/Dockerfiles/work/Dockerfile-7.1 index c361f15..86a59ca 100644 --- a/Dockerfiles/work/Dockerfile-7.1 +++ b/Dockerfiles/work/Dockerfile-7.1 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead. FROM devilbox/php-fpm:7.1-prod MAINTAINER "cytopia" @@ -15,7 +15,7 @@ LABEL \ ### -### Envs (Already set in parent container) +### Envs ### ENV BASH_PROFILE=".bashrc" @@ -23,9 +23,20 @@ ENV BASH_PROFILE=".bashrc" ### ### Install Tools ### - -# System dev tools RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + dirmngr \ + gnupg \ + && echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A1715D88E1DF1F24 \ + && echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu wily main" > /etc/apt/sources.list.d/git.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \ + && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" > /etc/apt/sources.list.d/mongo.list \ + && curl -q "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 2>/dev/null | apt-key add - \ + && echo "deb http://deb.nodesource.com/node_8.x jessie main" > /etc/apt/sources.list.d/node.list \ + && curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc 2>/dev/null | apt-key add - \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \ && apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ ack-grep \ @@ -49,14 +60,15 @@ RUN set -x \ less \ libc-dev \ make \ -# mongo-tools \ - mongodb-clients \ + mongodb-org-shell \ + mongodb-org-tools \ moreutils \ mysql-client \ nano \ net-tools \ netcat \ -# postgresql-client \ + nodejs \ + postgresql-client \ python-pip \ rubygems \ ruby-dev \ @@ -73,33 +85,69 @@ RUN set -x \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ && rm -rf /var/lib/apt/lists/* -## Node / NPM -#RUN set -x \ -# && mkdir -p /usr/local/src \ -# && VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" \ -# && wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=30 \ -# -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz \ -# && unxz /usr/local/src/node-${VERSION}-linux-x64.tar.xz \ -# && tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar -C /usr/local/src \ -# && ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \ -# && ln -s /usr/local/node/bin/* /usr/local/bin/ \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64.tar* \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/LICENSE \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/*.md \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \ -# && npm --version | grep -E '[.0-9]+' \ -# && node --version | grep -E '[.0-9]+' \ -# && rm -rf /root/.config -# -## Composer -#RUN set -x \ -# && curl -sS https://getcomposer.org/installer | php \ -# && mv composer.phar /usr/local/bin/composer \ -# && composer self-update -## && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' \ -## && rm -rf /root/.composer -# + +# composer +RUN set -x true \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && true +# drush +RUN set -x true \ + && git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ +&& cd /usr/local/src/drush \ +&& git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | tail -1 | sed 's/^.*tags\///g') \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \ +&& ln -s /usr/local/src/drush/drush /usr/local/bin/drush \ +&& rm -rf /usr/local/src/drush/.git \ +&& rm -rf /usr/local/src/drush/docs \ +&& rm -rf /usr/local/src/drush/examples \ +&& rm -rf /usr/local/src/drush/misc \ +&& rm -rf /usr/local/src/drush/tests \ +&& rm -rf /home/${MY_USER}/.composer \ + \ + && true +# drupalconsole +RUN set -x true \ + && curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal \ + && chmod +x /usr/local/bin/drupal \ + && true +# wpcli +RUN set -x true \ + && curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -L -o /usr/local/bin/wp \ + && chmod +x /usr/local/bin/wp \ + && true +# symfony +RUN set -x true \ + && curl https://symfony.com/installer -L -o /usr/local/bin/symfony \ + && chmod +x /usr/local/bin/symfony \ + && true +# laravel +RUN set -x true \ + && git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ +&& cd /usr/local/src/laravel-installer \ +&& git checkout $(git describe --abbrev=0 --tags) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \ +&& ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \ +&& rm -rf /usr/local/src/laravel-installer/laravel/.git \ + \ + && true +# phalcon +RUN set -x true \ + && git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ +&& cd /usr/local/src/phalcon-devtools \ +&& git checkout $(git describe --abbrev=0 --tags) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/phalcon-devtools \ +&& su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \ +&& ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \ +&& cd / \ +&& rm -rf /usr/local/src/phalcon-devtools/.git \ + \ + && true + ## Drush #RUN set -x \ # && DRUSH_VERSION="$( curl -q https://api.github.com/repos/drush-ops/drush/releases 2>/dev/null | grep tag_name | grep -Eo '\"[0-9.]+\"' | head -1 | sed 's/\"//g' )" \ @@ -278,6 +326,16 @@ RUN set -x \ && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi +RUN set -x \ + && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' && rm -rf /root/.composer \ + && drush --version | grep -E '[.0-9]+' && rm -rf /root/.drush \ + && drupal --version | grep -E 'Drupal Console Launcher\s*[.0-9]' \ + && wp --allow-root --version | grep -E '[.0-9]+' \ + && symfony --version | grep -E 'version\s*[.0-9]+' \ + && laravel --version | grep -E '(Installer|version)\s*[.0-9]+' \ + && phalcon commands | grep -E '[.0-9]+' \ + && true + ### ### Copy files diff --git a/Dockerfiles/work/Dockerfile-7.2 b/Dockerfiles/work/Dockerfile-7.2 index e66edae..7255450 100644 --- a/Dockerfiles/work/Dockerfile-7.2 +++ b/Dockerfiles/work/Dockerfile-7.2 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead. FROM devilbox/php-fpm:7.2-prod MAINTAINER "cytopia" @@ -15,7 +15,7 @@ LABEL \ ### -### Envs (Already set in parent container) +### Envs ### ENV BASH_PROFILE=".bashrc" @@ -23,9 +23,20 @@ ENV BASH_PROFILE=".bashrc" ### ### Install Tools ### - -# System dev tools RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + dirmngr \ + gnupg \ + && echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A1715D88E1DF1F24 \ + && echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu artful main" > /etc/apt/sources.list.d/git.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \ + && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" > /etc/apt/sources.list.d/mongo.list \ + && curl -q "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 2>/dev/null | apt-key add - \ + && echo "deb http://deb.nodesource.com/node_8.x stretch main" > /etc/apt/sources.list.d/node.list \ + && curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc 2>/dev/null | apt-key add - \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgsql.list \ && apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ ack-grep \ @@ -49,14 +60,15 @@ RUN set -x \ less \ libc-dev \ make \ -# mongo-tools \ - mongodb-clients \ + mongodb-org-shell \ + mongodb-org-tools \ moreutils \ mysql-client \ nano \ net-tools \ netcat \ -# postgresql-client \ + nodejs \ + postgresql-client \ python-pip \ rubygems \ ruby-dev \ @@ -73,33 +85,69 @@ RUN set -x \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ && rm -rf /var/lib/apt/lists/* -## Node / NPM -#RUN set -x \ -# && mkdir -p /usr/local/src \ -# && VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" \ -# && wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=30 \ -# -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz \ -# && unxz /usr/local/src/node-${VERSION}-linux-x64.tar.xz \ -# && tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar -C /usr/local/src \ -# && ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \ -# && ln -s /usr/local/node/bin/* /usr/local/bin/ \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64.tar* \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/LICENSE \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/*.md \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \ -# && npm --version | grep -E '[.0-9]+' \ -# && node --version | grep -E '[.0-9]+' \ -# && rm -rf /root/.config -# -## Composer -#RUN set -x \ -# && curl -sS https://getcomposer.org/installer | php \ -# && mv composer.phar /usr/local/bin/composer \ -# && composer self-update -## && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' \ -## && rm -rf /root/.composer -# + +# composer +RUN set -x true \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && true +# drush +RUN set -x true \ + && git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ +&& cd /usr/local/src/drush \ +&& git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | tail -1 | sed 's/^.*tags\///g') \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \ +&& ln -s /usr/local/src/drush/drush /usr/local/bin/drush \ +&& rm -rf /usr/local/src/drush/.git \ +&& rm -rf /usr/local/src/drush/docs \ +&& rm -rf /usr/local/src/drush/examples \ +&& rm -rf /usr/local/src/drush/misc \ +&& rm -rf /usr/local/src/drush/tests \ +&& rm -rf /home/${MY_USER}/.composer \ + \ + && true +# drupalconsole +RUN set -x true \ + && curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal \ + && chmod +x /usr/local/bin/drupal \ + && true +# wpcli +RUN set -x true \ + && curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -L -o /usr/local/bin/wp \ + && chmod +x /usr/local/bin/wp \ + && true +# symfony +RUN set -x true \ + && curl https://symfony.com/installer -L -o /usr/local/bin/symfony \ + && chmod +x /usr/local/bin/symfony \ + && true +# laravel +RUN set -x true \ + && git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ +&& cd /usr/local/src/laravel-installer \ +&& git checkout $(git describe --abbrev=0 --tags) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \ +&& su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \ +&& ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \ +&& rm -rf /usr/local/src/laravel-installer/laravel/.git \ + \ + && true +# phalcon +RUN set -x true \ + && git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ +&& cd /usr/local/src/phalcon-devtools \ +&& git checkout $(git describe --abbrev=0 --tags) \ + \ + && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/phalcon-devtools \ +&& su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \ +&& ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \ +&& cd / \ +&& rm -rf /usr/local/src/phalcon-devtools/.git \ + \ + && true + ## Drush #RUN set -x \ # && DRUSH_VERSION="$( curl -q https://api.github.com/repos/drush-ops/drush/releases 2>/dev/null | grep tag_name | grep -Eo '\"[0-9.]+\"' | head -1 | sed 's/\"//g' )" \ @@ -278,6 +326,16 @@ RUN set -x \ && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi +RUN set -x \ + && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' && rm -rf /root/.composer \ + && drush --version | grep -E '[.0-9]+' && rm -rf /root/.drush \ + && drupal --version | grep -E 'Drupal Console Launcher\s*[.0-9]' \ + && wp --allow-root --version | grep -E '[.0-9]+' \ + && symfony --version | grep -E 'version\s*[.0-9]+' \ + && laravel --version | grep -E '(Installer|version)\s*[.0-9]+' \ + && phalcon commands | grep -E '[.0-9]+' \ + && true + ### ### Copy files diff --git a/Dockerfiles/work/data/docker-entrypoint.sh b/Dockerfiles/work/data/docker-entrypoint.sh index c096807..d286146 100755 --- a/Dockerfiles/work/data/docker-entrypoint.sh +++ b/Dockerfiles/work/data/docker-entrypoint.sh @@ -1,73 +1,78 @@ -#!/bin/sh -# -# Available global variables: -# + MY_USER -# + MY_GROUP +#!/usr/bin/env bash set -e set -u +set -p pipefail ### -### Variables +### Globals ### -PHP_INI_PATH="/usr/local/etc/php.ini" -FPM_ERROR_LOG_CFG="/usr/local/etc/php-fpm.conf" -FPM_ACCESS_LOG_CFG="/usr/local/etc/php-fpm.d/zzz-docker.conf" + +# The following global variables are available by our Dockerfile itself: +# MY_USER +# MY_GROUP +# MY_UID +# MY_GID + +# Path to scripts to source +CONFIG_DIR="/docker-entrypoint.d" + +# php.ini.d directory +PHP_INI_DIR="/usr/local/etc/php/conf.d" + +# This file holds error and access log definitions +FPM_CONF_LOGFILE="/usr/local/etc/php-fpm.d/logfiles.conf" + +# PHP-FPM log dir FPM_LOG_DIR="/var/log/php" -#PHP_CUST_MODULE_DIR="/etc/php-modules.d" - +# Custom ini dir (to be copied to actual ini dir) PHP_CUST_INI_DIR="/etc/php-custom.d" -PHP_REAL_INI_DIR="/usr/local/etc/php.d" +# Supervisord config directory SUPERVISOR_CONFD="/etc/supervisor/conf.d" ### ### Source libs ### -init="$( find /docker-entrypoint.d -name '*.sh' -type f | sort -u )" +init="$( find "${CONFIG_DIR}" -name '*.sh' -type f | sort -u )" for f in ${init}; do # shellcheck disable=SC1090 . "${f}" done -### -### Set Debug level -### -DEBUG_LEVEL="$( get_debug_level "DEBUG_ENTRYPOINT" "0" )" -log "info" "Debug level: ${DEBUG_LEVEL}" "${DEBUG_LEVEL}" - - - -############################################################# -## Sanity checks -############################################################# - -if ! command -v socat >/dev/null 2>&1; then - log "err" "socat not found, but required." "${DEBUG_LEVEL}" - exit 1 -fi - - ############################################################# ## Entry Point ############################################################# +### +### Set Debug level +### +DEBUG_LEVEL="$( env_get "DEBUG_ENTRYPOINT" "0" )" +log "info" "Debug level: ${DEBUG_LEVEL}" "${DEBUG_LEVEL}" + + ### ### Change uid/gid ### -set_uid "NEW_UID" -set_gid "NEW_GID" +set_uid "NEW_UID" "${MY_USER}" "/home/${MY_USER}" "${DEBUG_LEVEL}" +set_gid "NEW_GID" "${MY_GROUP}" "/home/${MY_USER}" "${DEBUG_LEVEL}" ### ### Set timezone ### -set_timezone "TIMEZONE" "${PHP_INI_PATH}" +set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" + + +### +### Setup postfix +### +set_postfix "ENABLE_MAIL" "${MY_USER}" "${MY_GROUP}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### @@ -76,20 +81,16 @@ set_timezone "TIMEZONE" "${PHP_INI_PATH}" set_docker_logs \ "DOCKER_LOGS" \ "${FPM_LOG_DIR}" \ - "${FPM_ERROR_LOG_CFG}" \ - "${FPM_ACCESS_LOG_CFG}" - - -### -### Setup postfix -### -set_postfix "ENABLE_MAIL" + "${FPM_CONF_LOGFILE}" \ + "${MY_USER}" \ + "${MY_GROUP}" \ + "${DEBUG_LEVEL}" ### ### Validate socat port forwards ### -if ! port_forward_validate "FORWARD_PORTS_TO_LOCALHOST"; then +if ! port_forward_validate "FORWARD_PORTS_TO_LOCALHOST" "${DEBUG_LEVEL}"; then exit 1 fi @@ -101,7 +102,11 @@ for line in $( port_forward_get_lines "FORWARD_PORTS_TO_LOCALHOST" ); do lport="$( port_forward_get_lport "${line}" )" rhost="$( port_forward_get_rhost "${line}" )" rport="$( port_forward_get_rport "${line}" )" - supervisor_add_service "socat-${lport}-${rhost}-${rport}" "/usr/bin/socat tcp-listen:${lport},reuseaddr,fork tcp:${rhost}:${rport}" "${SUPERVISOR_CONFD}" + supervisor_add_service \ + "socat-${lport}-${rhost}-${rport}" \ + "/usr/bin/socat tcp-listen:${lport},reuseaddr,fork tcp:${rhost}:${rport}" \ + "${SUPERVISOR_CONFD}" \ + "${DEBUG_LEVEL}" done @@ -109,21 +114,21 @@ done ### Supervisor: rsyslogd & postfix ### if [ "$( env_get "ENABLE_MAIL" )" = "1" ]; then - supervisor_add_service "rsyslogd" "/usr/sbin/rsyslogd -n" "${SUPERVISOR_CONFD}" "1" - supervisor_add_service "postfix" "/usr/local/sbin/postfix.sh" "${SUPERVISOR_CONFD}" + supervisor_add_service "rsyslogd" "/usr/sbin/rsyslogd -n" "${SUPERVISOR_CONFD}" "${DEBUG_LEVEL}" "1" + supervisor_add_service "postfix" "/usr/local/sbin/postfix.sh" "${SUPERVISOR_CONFD}" "${DEBUG_LEVEL}" fi ### ### Supervisor: php-fpm ### -supervisor_add_service "php-fpm" "/usr/local/sbin/php-fpm" "${SUPERVISOR_CONFD}" +supervisor_add_service "php-fpm" "/usr/local/sbin/php-fpm" "${SUPERVISOR_CONFD}" "${DEBUG_LEVEL}" ### ### Copy custom *.ini files ### -copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_REAL_INI_DIR}" +copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### @@ -134,6 +139,7 @@ set_mds_settings "MYSQL_BACKUP_USER" "MYSQL_BACKUP_PASS" "MYSQL_BACKUP_HOST" ### -### Start +### Startup ### +log "info" "Starting supervisord" "${DEBUG_LEVEL}" exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf diff --git a/build/ansible/DOCKERFILES/Dockerfile-base.j2 b/build/ansible/DOCKERFILES/Dockerfile-base.j2 index 7acd5c0..b672abc 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-base.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-base.j2 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. FROM php:{{ php_version }}-fpm MAINTAINER "cytopia" diff --git a/build/ansible/DOCKERFILES/Dockerfile-mods.j2 b/build/ansible/DOCKERFILES/Dockerfile-mods.j2 index 7fdccb8..46383db 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-mods.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-mods.j2 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead. FROM devilbox/php-fpm:{{ php_version }}-base MAINTAINER "cytopia" diff --git a/build/ansible/DOCKERFILES/Dockerfile-prod.j2 b/build/ansible/DOCKERFILES/Dockerfile-prod.j2 index df75196..1015382 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-prod.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-prod.j2 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. FROM devilbox/php-fpm:{{ php_version }}-mods MAINTAINER "cytopia" @@ -35,19 +35,6 @@ RUN set -x \ -### -### Configure -### -RUN set -x \ - && { \ - echo "[mail function]"; \ - echo "sendmail_path = /usr/sbin/sendmail -t -i"; \ - echo ";mail.force_extra_parameters ="; \ - echo "mail.add_x_header = On"; \ - echo "mail.log = /var/log/php/mail.log"; \ - } > /usr/local/etc/php/conf.d/devilbox-mail.ini - - {% if debug %} ### ### Verify diff --git a/build/ansible/DOCKERFILES/Dockerfile-work.j2 b/build/ansible/DOCKERFILES/Dockerfile-work.j2 index 67e8589..b9787be 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-work.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-work.j2 @@ -1,4 +1,4 @@ -# Auto-generated via Ansible +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead. FROM devilbox/php-fpm:{{ php_version }}-prod MAINTAINER "cytopia" @@ -15,7 +15,7 @@ LABEL \ ### -### Envs (Already set in parent container) +### Envs ### ENV BASH_PROFILE=".bashrc" @@ -23,9 +23,37 @@ ENV BASH_PROFILE=".bashrc" ### ### Install Tools ### - -# System dev tools RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + dirmngr \ + gnupg \ +{% for repo in apt_repositories_enabled %} +{# Not disabled #} +{% if ('disabled' not in apt_repositories_available[repo]) or (php_version not in apt_repositories_available[repo]['disabled']) %} +{# Version specific pre-command available? #} +{% if php_version in apt_repositories_available[repo] and 'pre' in apt_repositories_available[repo][php_version] %} + && {{ apt_repositories_available[repo][php_version]['pre'] }} \ +{# Generic pre-command available? #} +{% elif 'all' in apt_repositories_available[repo] and 'pre' in apt_repositories_available[repo]['all'] %} + && {{ apt_repositories_available[repo]['all']['pre'] }} \ +{% endif %} +{# Version specific key available? #} +{% if php_version in apt_repositories_available[repo] and 'key' in apt_repositories_available[repo][php_version] %} + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv {{ apt_repositories_available[repo][php_version]['key'] }} \ +{# Generic key available? #} +{% elif 'all' in apt_repositories_available[repo] and 'key' in apt_repositories_available[repo]['all'] %} + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv {{ apt_repositories_available[repo]['all']['key'] }} \ +{% endif %} +{# Version specific repository available? #} +{% if php_version in apt_repositories_available[repo] and 'deb' in apt_repositories_available[repo][php_version] %} + && echo "{{ apt_repositories_available[repo][php_version]['deb'] }}" > /etc/apt/sources.list.d/{{ repo }}.list \ +{# Generic repository available? #} +{% else %} + && echo "{{ apt_repositories_available[repo]['all']['deb'] }}" > /etc/apt/sources.list.d/{{ repo }}.list \ +{% endif %} +{% endif %} +{% endfor %} && apt-get update \ && apt-get install --no-install-recommends --no-install-suggests -y \ ack-grep \ @@ -49,14 +77,15 @@ RUN set -x \ less \ libc-dev \ make \ -# mongo-tools \ - mongodb-clients \ + mongodb-org-shell \ + mongodb-org-tools \ moreutils \ mysql-client \ nano \ net-tools \ netcat \ -# postgresql-client \ + nodejs \ + postgresql-client \ python-pip \ rubygems \ ruby-dev \ @@ -73,97 +102,37 @@ RUN set -x \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ && rm -rf /var/lib/apt/lists/* -## Node / NPM -#RUN set -x \ -# && mkdir -p /usr/local/src \ -# && VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )" \ -# && wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=30 \ -# -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz \ -# && unxz /usr/local/src/node-${VERSION}-linux-x64.tar.xz \ -# && tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar -C /usr/local/src \ -# && ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \ -# && ln -s /usr/local/node/bin/* /usr/local/bin/ \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64.tar* \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/LICENSE \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/*.md \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \ -# && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \ -# && npm --version | grep -E '[.0-9]+' \ -# && node --version | grep -E '[.0-9]+' \ -# && rm -rf /root/.config -# -## Composer -#RUN set -x \ -# && curl -sS https://getcomposer.org/installer | php \ -# && mv composer.phar /usr/local/bin/composer \ -# && composer self-update -## && composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' \ -## && rm -rf /root/.composer -# -## Drush -#RUN set -x \ -# && DRUSH_VERSION="$( curl -q https://api.github.com/repos/drush-ops/drush/releases 2>/dev/null | grep tag_name | grep -Eo '\"[0-9.]+\"' | head -1 | sed 's/\"//g' )" \ -# && mkdir -p /usr/local/src \ -# && git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ -# && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \ -# && v="${DRUSH_VERSION}" su ${MY_USER} -p -c 'cd /usr/local/src/drush && git checkout ${v}' \ -# && su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \ -# && ln -s /usr/local/src/drush/drush /usr/local/bin/drush \ -# && drush --version | grep -E '[.0-9]+' \ -# && rm -rf /usr/local/src/drush/.git \ -# && rm -rf /usr/local/src/drush/docs \ -# && rm -rf /usr/local/src/drush/examples \ -# && rm -rf /usr/local/src/drush/misc \ -# && rm -rf /usr/local/src/drush/tests \ -# && rm -rf /root/.drush \ -# && rm -rf /home/${MY_USER}/.composer -# -## Drupal Console -#RUN set -x \ -# && curl https://drupalconsole.com/installer -L -o drupal.phar \ -# && mv drupal.phar /usr/local/bin/drupal \ -# && chmod +x /usr/local/bin/drupal -## && drupal --version | grep -E 'version\s*[.0-9]' -# -## WP-CLI -#RUN set -x \ -# && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ -# && mv wp-cli.phar /usr/local/bin/wp \ -# && chmod +x /usr/local/bin/wp \ -# && wp cli update \ -# && wp --allow-root --version | grep -E '[.0-9]+' -# -## Symfony CLI -#RUN set -x \ -# && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \ -# && chmod +x /usr/local/bin/symfony \ -# && symfony --version | grep -E 'version\s*[.0-9]+' -# -## Laravel CLI -#RUN set -x \ -# && mkdir -p /usr/local/src \ -# && git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ -# && cd /usr/local/src/laravel-installer \ -# && git checkout $(git describe --abbrev=0 --tags) \ -# && chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \ -# && su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \ -# && ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \ -# && rm -rf /usr/local/src/laravel-installer/laravel/.git -## && laravel --version | grep -E 'version\s*[.0-9]+' \ -## && rm -rf /home/${MY_USER}/.composer -# -## Phalcon DevTools -##RUN set -x \ -## && mkdir -p /usr/local/src \ -## && git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ -## && cd /usr/local/src/phalcon-devtools \ -## && git checkout $(git tag | grep 'v3.0' | sort -V | tail -1) \ -## && su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \ -## && ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \ -## && cd / \ -## && rm -rf /usr/local/src/phalcon-devtools/.git \ -## && phalcon commands | grep -E '[.0-9]+' -# + +{% for tool in software_enabled %} +{# Not disabled #} +{% if ('disabled' not in software_available[tool]) or (php_version not in software_available[tool]['disabled']) %} +# {{ tool }} +RUN set -x true \ +{# Version specific pre-command available? #} +{% if php_version in software_available[tool] and 'pre' in software_available[tool][php_version] %} + && {{ software_available[tool][php_version]['pre'] }} \ +{# Generic pre-command available? #} +{% elif 'all' in software_available[tool] and 'pre' in software_available[tool]['all'] %} + && {{ software_available[tool]['all']['pre'] }} \ +{% endif %} +{# Version specific command available? #} +{% if php_version in software_available[tool] and 'command' in software_available[tool][php_version] %} + && {{ software_available[tool][php_version]['command'] }} \ +{# Generic command available? #} +{% else %} + && {{ software_available[tool]['all']['command'] }} \ +{% endif %} +{# Version specific post-command available? #} +{% if php_version in software_available[tool] and 'post' in software_available[tool][php_version] %} + && {{ software_available[tool][php_version]['post'] }} \ +{# Generic post-command available? #} +{% elif 'all' in software_available[tool] and 'post' in software_available[tool]['all'] %} + && {{ software_available[tool]['all']['post'] }} \ +{% endif %} + && true +{% endif %} +{% endfor %} + ## Mysqldump-secure #RUN set -x \ # && mkdir -p /usr/local/src \ @@ -279,6 +248,15 @@ RUN set -x \ && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi +RUN set -x \ +{% for tool in software_enabled %} +{# Not disabled #} +{% if ('disabled' not in software_available[tool]) or (php_version not in software_available[tool]['disabled']) %} + && {{ software_available[tool]['check'] }} \ +{% endif %} +{% endfor %} + && true + {% endif %} ### diff --git a/build/ansible/group_vars/all.yml b/build/ansible/group_vars/all.yml index 9a1c9b5..dec8e83 100644 --- a/build/ansible/group_vars/all.yml +++ b/build/ansible/group_vars/all.yml @@ -27,8 +27,201 @@ php_all_versions: - 7.2 -php_conf_dir: /usr/local/etc/php.d +################################################################################ +# Defines for Dockerfile "work" +################################################################################ + + +### +### Apt repositories to actually enable +### +apt_repositories_enabled: + - backports + - git + - mongo + - node + - pgsql + + +### +### Software to actually install +### +software_enabled: + - composer + - drush + - drupalconsole + - wpcli + - symfony + - laravel + - phalcon + + + + +### +### All available extra repositories +### +# all: is generic version of defines +# 7.2: is specific version of defines +# disabled: [optional] Array of PHP versions for which to disable this module +# +# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4: +# deb: Deb line to add to sources list +# key: [optional] Key id to add for repository +# pre: [optional] Run custom command to add gpg key for repository +# +apt_repositories_available: + backports: + all: + deb: deb http://ftp.debian.org/debian jessie-backports main + git: + disabled: [] + 7.2: + deb: deb http://ppa.launchpad.net/git-core/ppa/ubuntu artful main + all: + deb: deb http://ppa.launchpad.net/git-core/ppa/ubuntu wily main + key: A1715D88E1DF1F24 + mongo: + #disabled: [7.2] + all: + deb: deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main + key: 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 + node: + disabled: [] + 7.2: + deb: deb http://deb.nodesource.com/node_8.x stretch main + all: + deb: deb http://deb.nodesource.com/node_8.x jessie main + pre: curl -q "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 2>/dev/null | apt-key add - + pgsql: + #disabled: [7.2] + 7.2: + deb: deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main + all: + deb: deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main + pre: curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc 2>/dev/null | apt-key add - + + +### +### All available software +### +# all: is generic version of defines +# 7.2: is specific version of defines +# disabled: [optional] Array of PHP versions for which to disable this module +# +# all, 7.2, 7.1, 7.0, 5.6, 5.5, 5.4: +# pre: [optional] Run command before 'command:' statement +# command: Command to execute +# pre: [optional] Run command after 'command:' statement +# +software_available: + composer: + check: composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' && rm -rf /root/.composer + all: + command: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + drush: + check: drush --version | grep -E '[.0-9]+' && rm -rf /root/.drush + 5.5: + pre: | + git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ + && cd /usr/local/src/drush \ + && git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | sed 's/^.*tags\///g' | grep ^8 | tail -1) \ + 5.4: + pre: | + git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ + && cd /usr/local/src/drush \ + && git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | sed 's/^.*tags\///g' | grep ^8 | tail -1) \ + all: + pre: | + git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ + && cd /usr/local/src/drush \ + && git checkout $(git for-each-ref --format='%(*creatordate:raw)%(creatordate:raw) %(refname)' refs/tags | sort -n | tail -1 | sed 's/^.*tags\///g') \ + command: | + chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/drush \ + && su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/drush && composer install --no-interaction --no-progress' \ + && ln -s /usr/local/src/drush/drush /usr/local/bin/drush \ + && rm -rf /usr/local/src/drush/.git \ + && rm -rf /usr/local/src/drush/docs \ + && rm -rf /usr/local/src/drush/examples \ + && rm -rf /usr/local/src/drush/misc \ + && rm -rf /usr/local/src/drush/tests \ + && rm -rf /home/${MY_USER}/.composer \ + drupalconsole: + disabled: [5.4] + check: drupal --version | grep -E 'Drupal Console Launcher\s*[.0-9]' + all: + command: curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal + post: chmod +x /usr/local/bin/drupal + laravel: + check: laravel --version | grep -E '(Installer|version)\s*[.0-9]+' + 7.0: + pre: | + git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ + && cd /usr/local/src/laravel-installer \ + && git checkout v2.0.0 \ + 5.6: + pre: | + git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ + && cd /usr/local/src/laravel-installer \ + && git checkout v2.0.0 \ + 5.5: + pre: | + git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ + && cd /usr/local/src/laravel-installer \ + && git checkout v2.0.0 \ + 5.4: + pre: | + git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ + && cd /usr/local/src/laravel-installer \ + && git checkout v1.3.7 \ + all: + pre: | + git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ + && cd /usr/local/src/laravel-installer \ + && git checkout $(git describe --abbrev=0 --tags) \ + command: | + chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/laravel-installer \ + && su - ${MY_USER} -c 'PATH=/usr/local/bin:$PATH; cd /usr/local/src/laravel-installer && composer install' \ + && ln -s /usr/local/src/laravel-installer/laravel /usr/local/bin/laravel \ + && rm -rf /usr/local/src/laravel-installer/laravel/.git \ + phalcon: + check: phalcon commands | grep -E '[.0-9]+' + 5.4: + pre: | + git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ + && cd /usr/local/src/phalcon-devtools \ + && git checkout v2.0.9 \ + all: + pre: | + git clone https://github.com/phalcon/phalcon-devtools /usr/local/src/phalcon-devtools \ + && cd /usr/local/src/phalcon-devtools \ + && git checkout $(git describe --abbrev=0 --tags) \ + command: | + chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/phalcon-devtools \ + && su - ${MY_USER} -c 'cd /usr/local/src/phalcon-devtools && ./phalcon.sh' \ + && ln -s /usr/local/src/phalcon-devtools/phalcon.php /usr/local/bin/phalcon \ + && cd / \ + && rm -rf /usr/local/src/phalcon-devtools/.git \ + symfony: + check: symfony --version | grep -E 'version\s*[.0-9]+' + all: + command: curl https://symfony.com/installer -L -o /usr/local/bin/symfony + post: chmod +x /usr/local/bin/symfony + wpcli: + check: wp --allow-root --version | grep -E '[.0-9]+' + all: + command: curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -L -o /usr/local/bin/wp + post: chmod +x /usr/local/bin/wp + + + + + + +################################################################################ +# Defines for Dockerfile "mods" +################################################################################ ### ### Extensions to actually enable @@ -120,7 +313,6 @@ extensions_enabled: ### ### All available php modules ### - # all: is generic version of defines # 7.2: is specific version of defines # disabled: [optional] Array of PHP versions for which to disable this module