From 1962327de10ca5786dca00f0e0007f64e3a5e91d Mon Sep 17 00:00:00 2001 From: Jess Warburton <34153688+jwrbrtn@users.noreply.github.com> Date: Fri, 20 Jul 2018 12:05:31 +1000 Subject: [PATCH 01/19] Corrects folder locations in which to run docker-compose commands for caddy (#1721) --- DOCUMENTATION/content/guides/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DOCUMENTATION/content/guides/index.md b/DOCUMENTATION/content/guides/index.md index 3cf1f38a..05c72a77 100644 --- a/DOCUMENTATION/content/guides/index.md +++ b/DOCUMENTATION/content/guides/index.md @@ -197,7 +197,7 @@ This is needed Prior to Creating Let's Encypt ## Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt ``` -$root@server:~/laravel/laradock/caddy# docker-compose up caddy +$root@server:~/laravel/laradock# docker-compose up caddy ``` You'll be prompt here to enter your email... you may enter it or not @@ -218,8 +218,8 @@ After it finishes, press `Ctrl` + `C` to exit. ## Stop All Containers and ReRun Caddy and Other Containers on Background ``` -$root@server:~/laravel/laradock/caddy# docker-compose down -$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy +$root@server:~/laravel/laradock# docker-compose down +$root@server:~/laravel/laradock# docker-compose up -d mysql caddy ``` View your Site in the Browser Securely Using HTTPS (https://yourdomain.com) From fbc2afee713de17050b77fc563ff2827e29b838c Mon Sep 17 00:00:00 2001 From: vladyslavstartsev Date: Fri, 20 Jul 2018 10:44:07 +0300 Subject: [PATCH 02/19] implemented option to add bcmath to laradock php-worker (#1716) * implemented option to add bcmath to laradock php-worker * updated docs --- DOCUMENTATION/content/documentation/index.md | 1 + docker-compose.yml | 1 + env-example | 1 + php-worker/Dockerfile | 6 ++++++ 4 files changed, 9 insertions(+) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 745cf237..2097237e 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -522,6 +522,7 @@ b) add a new service container by simply copy-paste this section below PHP-FPM c context: ./php-worker args: - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} #Optionally install PGSQL PHP drivers + - INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH} #Optionally install BCMath php package volumes_from: - applications depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index 9ffde6bd..d9b21128 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -168,6 +168,7 @@ services: args: - PHP_VERSION=${PHP_VERSION} - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} + - INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} - ./php-worker/supervisord.d:/etc/supervisord.d diff --git a/env-example b/env-example index 536a9e98..b928a8e0 100644 --- a/env-example +++ b/env-example @@ -153,6 +153,7 @@ PHP_FPM_INSTALL_CALENDAR=false ### PHP_WORKER ############################################ PHP_WORKER_INSTALL_PGSQL=false +PHP_WORKER_INSTALL_BCMATH=false ### NGINX ################################################# diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 158a1664..d7c677d3 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -25,6 +25,12 @@ RUN apk --update add wget \ RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached +#Install BCMath package: +ARG INSTALL_BCMATH=false +RUN if [ ${INSTALL_BCMATH} = true ]; then \ + docker-php-ext-install bcmath \ +;fi + # Install PostgreSQL drivers: ARG INSTALL_PGSQL=false RUN if [ ${INSTALL_PGSQL} = true ]; then \ From 679d2b0aba3ceca5549a7520eaf375c0e2ab22ab Mon Sep 17 00:00:00 2001 From: Yusuf Kandemir <6266078+yusufkandemir@users.noreply.github.com> Date: Fri, 20 Jul 2018 10:45:12 +0300 Subject: [PATCH 03/19] Link fixes and changes in Documentation (#1539) * Fix guide links * Changed absolute link to relative --- DOCUMENTATION/content/documentation/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 2097237e..4135df41 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -323,7 +323,7 @@ PHP_FPM_INSTALL_PHPDBG=true ## Setup remote debugging for PhpStorm on Linux - - Make sure you have followed the steps above in the [Install Xdebug section](http://laradock.io/documentation/#install-xdebug). + - Make sure you have followed the steps above in the [Install Xdebug section](#install-xdebug). - Make sure Xdebug accepts connections and listens on port 9000. (Should be default configuration). @@ -407,7 +407,7 @@ To learn more about how Docker publishes ports, please read [this excellent post ## Setup Laravel and Docker on Digital Ocean -### [Full Guide Here](https://github.com/laradock/laradock/blob/master/_guides/digital_ocean.md) +### [Full Guide Here](/guides/#Digital-Ocean) @@ -1496,7 +1496,7 @@ e) set it to `true` ## PHPStorm Debugging Guide Remote debug Laravel web and phpunit tests. -[**Debugging Guide Here**](https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md) +[**Debugging Guide Here**](/guides/#PHPStorm-Debugging) From b2ab970d04e4c4c958ff25fd1ea09af91c39df37 Mon Sep 17 00:00:00 2001 From: brunen9 Date: Fri, 20 Jul 2018 13:48:09 +0600 Subject: [PATCH 04/19] Upgrade PostgreSQL client to version 10. (#1508) --- workspace/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 4f1e4645..0c885807 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -766,7 +766,11 @@ ARG INSTALL_PG_CLIENT=false RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \ # Install the pgsql client - apt-get -y install postgresql-client \ + apt-get install wget \ + && add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" \ + && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-get -y install postgresql-client-10 \ ;fi ########################################################################### From 1acbebc2a3fd90859953799a95e98cd9efea3ea3 Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Sat, 28 Jul 2018 03:08:01 -0400 Subject: [PATCH 05/19] Update MSSQL Drivers To Newest Version (#1707) Remove version lock from pecl install Update to Debian 9 repos since our image is Debian 9 Remove duplicate locales-gen line Closes #1622 --- php-fpm/Dockerfile | 8 +++++--- workspace/Dockerfile | 19 ++++--------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 8a76ab75..5dc801ff 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -416,14 +416,16 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux apt-get install -y apt-transport-https gnupg \ && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ - && curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \ && apt-get update -yqq \ # Install Dependencies - && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql locales \ + && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql17 locales \ && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ + # link local aliases + && ln -s /etc/locale.alias /usr/share/locale/locale.alias \ && locale-gen \ # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. - && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ + && pecl install pdo_sqlsrv sqlsrv \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \ && php -m | grep -q 'pdo_sqlsrv' \ && php -m | grep -q 'sqlsrv' \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 0c885807..1921bac5 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -641,23 +641,12 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ apt-get update -yqq && \ - ACCEPT_EULA=Y apt-get install -yqq msodbcsql=13.0.1.0-1 mssql-tools=14.0.2.0-1 && \ - apt-get install -yqq unixodbc-dev-utf16 && \ - ln -sfn /opt/mssql-tools/bin/sqlcmd-13.0.1.0 /usr/bin/sqlcmd && \ - ln -sfn /opt/mssql-tools/bin/bcp-13.0.1.0 /usr/bin/bcp && \ - ACCEPT_EULA=Y apt-get install -yqq \ - unixodbc \ - unixodbc-dev \ - libgss3 \ - odbcinst \ - msodbcsql \ - locales && \ - echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ - locale-gen && \ - pecl install sqlsrv-4.3.0 pdo_sqlsrv-4.3.0 && \ - apt-get install -y locales && \ + ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools unixodbc unixodbc-dev libgss3 odbcinst locales && \ + ln -sfn /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd && \ + ln -sfn /opt/mssql-tools/bin/bcp /usr/bin/bcp && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ locale-gen && \ + pecl install sqlsrv pdo_sqlsrv && \ echo "extension=sqlsrv.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-sqlsrv.ini && \ echo "extension=pdo_sqlsrv.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-pdo_sqlsrv.ini \ && php -m | grep -q 'sqlsrv' \ From e92f08e323dfa2fd488ab92ef38c5f224fb930e8 Mon Sep 17 00:00:00 2001 From: JapSeyz Date: Sat, 28 Jul 2018 09:11:24 +0200 Subject: [PATCH 06/19] -u no longer supported (#1733) * -u no longer supported https://varnish-cache.org/docs/4.1/reference/varnishd.html https://support.jpgottech.com/knowledgebase.php?article=90 issue #1732 --- varnish/default.vcl | 6 +++--- varnish/start.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/varnish/default.vcl b/varnish/default.vcl index 155a863a..73099c39 100644 --- a/varnish/default.vcl +++ b/varnish/default.vcl @@ -266,7 +266,7 @@ sub vcl_hit { return (deliver); } else { # No candidate for grace. Fetch a fresh object. - return(fetch); + return(miss); } } else { # backend is sick - use full grace @@ -275,12 +275,12 @@ sub vcl_hit { return (deliver); } else { # no graced object. - return (fetch); + return (miss); } } # fetch & deliver once we get the result - return (fetch); # Dead code, keep as a safeguard + return (miss); # Dead code, keep as a safeguard } sub vcl_miss { diff --git a/varnish/start.sh b/varnish/start.sh index e14511a9..7e7c28a5 100644 --- a/varnish/start.sh +++ b/varnish/start.sh @@ -11,7 +11,7 @@ exec bash -c \ "exec varnishd \ -a :$VARNISH_PORT \ -T localhost:6082 \ - -F -u varnish \ + -F \ -f $VARNISH_CONFIG \ -s malloc,$CACHE_SIZE \ - $VARNISHD_PARAMS" \ No newline at end of file + $VARNISHD_PARAMS" From 764e4845997335d8e7dfffdc370dbc9c15c6e61c Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sun, 29 Jul 2018 12:00:13 +0800 Subject: [PATCH 07/19] Env variable conflict (#1734) * php-fpm and workspace arg var rename: PHP_VERSION to LARADOCK_PHP_VERSION. * travis-ci skip phpbdg --- docker-compose.yml | 4 +-- php-fpm/Dockerfile | 13 ++++---- travis-build.sh | 1 + workspace/Dockerfile | 74 +++++++++++++++++++------------------------- 4 files changed, 40 insertions(+), 52 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d9b21128..f865989a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,7 +47,7 @@ services: build: context: ./workspace args: - - PHP_VERSION=${PHP_VERSION} + - LARADOCK_PHP_VERSION=${PHP_VERSION} - INSTALL_SUBVERSION=${WORKSPACE_INSTALL_SUBVERSION} - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} - INSTALL_PHPDBG=${WORKSPACE_INSTALL_PHPDBG} @@ -115,7 +115,7 @@ services: build: context: ./php-fpm args: - - PHP_VERSION=${PHP_VERSION} + - LARADOCK_PHP_VERSION=${PHP_VERSION} - INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG} - INSTALL_PHPDBG=${PHP_FPM_INSTALL_PHPDBG} - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 5dc801ff..45b91d2f 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -12,12 +12,14 @@ # Note: Base Image name format {image-tag}-{php-version} # -ARG PHP_VERSION=${PHP_VERSION} +ARG LARADOCK_PHP_VERSION -FROM laradock/php-fpm:2.2-${PHP_VERSION} +FROM laradock/php-fpm:2.2-${LARADOCK_PHP_VERSION} LABEL maintainer="Mahmoud Zalt " +ARG LARADOCK_PHP_VERSION + # Set Environment Variables ENV DEBIAN_FRONTEND noninteractive @@ -114,11 +116,10 @@ RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/e ########################################################################### ARG INSTALL_PHPDBG=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_PHPDBG} = true ]; then \ # Load the xdebug extension only with phpunit commands - apt-get install -y --force-yes php${PHP_VERSION}-phpdbg \ + apt-get install -y --force-yes php${LARADOCK_PHP_VERSION}-phpdbg \ ;fi ########################################################################### @@ -488,9 +489,7 @@ RUN if [ ${INSTALL_CALENDAR} = true ]; then \ # Check PHP version: ########################################################################### -ARG PHP_VERSION=${PHP_VERSION} - -RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}." +RUN php -v | head -n 1 | grep -q "PHP ${LARADOCK_PHP_VERSION}." # #-------------------------------------------------------------------------- diff --git a/travis-build.sh b/travis-build.sh index c72f51df..d6aec972 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -14,6 +14,7 @@ if [ -n "${PHP_VERSION}" ]; then cp env-example .env sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env sed -i -- 's/=false/=true/g' .env + sed -i -- 's/PHPDBG=true/PHPDBG=false/g' .env cat .env docker-compose build ${BUILD_SERVICE} docker images diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 1921bac5..60c6cdb1 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -12,12 +12,14 @@ # Note: Base Image name format {image-tag}-{php-version} # -ARG PHP_VERSION=${PHP_VERSION} +ARG LARADOCK_PHP_VERSION -FROM laradock/workspace:2.2-${PHP_VERSION} +FROM laradock/workspace:2.2-${LARADOCK_PHP_VERSION} LABEL maintainer="Mahmoud Zalt " +ARG LARADOCK_PHP_VERSION + # Set Environment Variables ENV DEBIAN_FRONTEND noninteractive @@ -179,11 +181,10 @@ RUN if [ ${INSTALL_DRUSH} = true ]; then \ USER root ARG INSTALL_SOAP=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the PHP SOAP extension - apt-get -y install libxml2-dev php${PHP_VERSION}-soap \ + apt-get -y install libxml2-dev php${LARADOCK_PHP_VERSION}-soap \ ;fi ########################################################################### @@ -191,11 +192,10 @@ RUN if [ ${INSTALL_SOAP} = true ]; then \ ########################################################################### ARG INSTALL_LDAP=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_LDAP} = true ]; then \ apt-get install -y libldap2-dev && \ - apt-get install -y php${PHP_VERSION}-ldap \ + apt-get install -y php${LARADOCK_PHP_VERSION}-ldap \ ;fi ########################################################################### @@ -203,10 +203,9 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \ ########################################################################### ARG INSTALL_IMAP=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_IMAP} = true ]; then \ - apt-get install -y php${PHP_VERSION}-imap \ + apt-get install -y php${LARADOCK_PHP_VERSION}-imap \ ;fi ########################################################################### @@ -229,21 +228,20 @@ RUN if [ ${INSTALL_SUBVERSION} = true ]; then \ USER root ARG INSTALL_XDEBUG=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # Load the xdebug extension only with phpunit commands - apt-get install -y php${PHP_VERSION}-xdebug && \ - sed -i 's/^;//g' /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \ + apt-get install -y php${LARADOCK_PHP_VERSION}-xdebug && \ + sed -i 's/^;//g' /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-xdebug.ini && \ echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \ ;fi # ADD for REMOTE debugging -COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini +COPY ./xdebug.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/xdebug.ini -RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \ - sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \ - sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini +RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/xdebug.ini && \ + sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/xdebug.ini && \ + sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/xdebug.ini ########################################################################### # Phpdbg: @@ -252,11 +250,10 @@ RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${P USER root ARG INSTALL_PHPDBG=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_PHPDBG} = true ]; then \ # Load the xdebug extension only with phpunit commands - apt-get install -y --force-yes php${PHP_VERSION}-phpdbg \ + apt-get install -y --force-yes php${LARADOCK_PHP_VERSION}-phpdbg \ ;fi ########################################################################### @@ -302,18 +299,17 @@ RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \ ########################################################################### ARG INSTALL_MONGO=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_MONGO} = true ]; then \ # Install the mongodb extension if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ pecl install mongo && \ - echo "extension=mongo.so" >> /etc/php/${PHP_VERSION}/mods-available/mongo.ini && \ - ln -s /etc/php/${PHP_VERSION}/mods-available/mongo.ini /etc/php/${PHP_VERSION}/cli/conf.d/30-mongo.ini \ + echo "extension=mongo.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/mongo.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/mongo.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-mongo.ini \ ;fi && \ pecl install mongodb && \ - echo "extension=mongodb.so" >> /etc/php/${PHP_VERSION}/mods-available/mongodb.ini && \ - ln -s /etc/php/${PHP_VERSION}/mods-available/mongodb.ini /etc/php/${PHP_VERSION}/cli/conf.d/30-mongodb.ini \ + echo "extension=mongodb.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/mongodb.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/mongodb.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-mongodb.ini \ ;fi ########################################################################### @@ -321,13 +317,12 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ########################################################################### ARG INSTALL_AMQP=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_AMQP} = true ]; then \ apt-get install librabbitmq-dev -y && \ pecl -q install amqp && \ - echo "extension=amqp.so" >> /etc/php/${PHP_VERSION}/mods-available/amqp.ini && \ - ln -s /etc/php/${PHP_VERSION}/mods-available/amqp.ini /etc/php/${PHP_VERSION}/cli/conf.d/30-amqp.ini \ + echo "extension=amqp.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/amqp.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/amqp.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-amqp.ini \ ;fi ########################################################################### @@ -335,12 +330,11 @@ RUN if [ ${INSTALL_AMQP} = true ]; then \ ########################################################################### ARG INSTALL_PHPREDIS=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ # Install Php Redis extension printf "\n" | pecl -q install -o -f redis && \ - echo "extension=redis.so" >> /etc/php/${PHP_VERSION}/mods-available/redis.ini && \ + echo "extension=redis.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/redis.ini && \ phpenmod redis \ ;fi @@ -349,7 +343,6 @@ RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ ########################################################################### ARG INSTALL_SWOOLE=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_SWOOLE} = true ]; then \ # Install Php Swoole Extension @@ -362,8 +355,8 @@ RUN if [ ${INSTALL_SWOOLE} = true ]; then \ pecl install swoole; \ fi \ fi && \ - echo "extension=swoole.so" >> /etc/php/${PHP_VERSION}/mods-available/swoole.ini && \ - ln -s /etc/php/${PHP_VERSION}/mods-available/swoole.ini /etc/php/${PHP_VERSION}/cli/conf.d/20-swoole.ini \ + echo "extension=swoole.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini && \ + ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/swoole.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-swoole.ini \ ;fi ########################################################################### @@ -491,7 +484,6 @@ RUN if [ ${INSTALL_YARN} = true ]; then \ USER root ARG INSTALL_AEROSPIKE=false -ARG PHP_VERSION=${PHP_VERSION} ARG AEROSPIKE_PHP_REPOSITORY RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ @@ -508,9 +500,9 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ - && echo 'extension=aerospike.so' >> /etc/php/${PHP_VERSION}/cli/conf.d/aerospike.ini \ - && echo 'aerospike.udf.lua_system_path=/usr/local/aerospike/lua' >> /etc/php/${PHP_VERSION}/cli/conf.d/aerospike.ini \ - && echo 'aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua' >> /etc/php/${PHP_VERSION}/cli/conf.d/aerospike.ini \ + && echo 'extension=aerospike.so' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_system_path=/usr/local/aerospike/lua' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \ + && echo 'aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \ ;fi ########################################################################### @@ -520,15 +512,14 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ USER root ARG INSTALL_V8JS=false -ARG PHP_VERSION=${PHP_VERSION} RUN if [ ${INSTALL_V8JS} = true ]; then \ # Install the php V8JS extension add-apt-repository -y ppa:pinepain/libv8-archived \ && apt-get update -yqq \ - && apt-get install -y php${PHP_VERSION}-xml php${PHP_VERSION}-dev php-pear libv8-5.4 \ + && apt-get install -y php${LARADOCK_PHP_VERSION}-xml php${LARADOCK_PHP_VERSION}-dev php-pear libv8-5.4 \ && pecl install v8js \ - && echo "extension=v8js.so" >> /etc/php/${PHP_VERSION}/cli/php.ini \ + && echo "extension=v8js.so" >> /etc/php/${LARADOCK_PHP_VERSION}/cli/php.ini \ ;fi ########################################################################### @@ -626,7 +617,6 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ ########################################################################### ARG INSTALL_MSSQL=false -ARG PHP_VERSION=${PHP_VERSION} RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ @@ -647,8 +637,8 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ locale-gen && \ pecl install sqlsrv pdo_sqlsrv && \ - echo "extension=sqlsrv.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-sqlsrv.ini && \ - echo "extension=pdo_sqlsrv.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-pdo_sqlsrv.ini \ + echo "extension=sqlsrv.so" > /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-sqlsrv.ini && \ + echo "extension=pdo_sqlsrv.so" > /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/20-pdo_sqlsrv.ini \ && php -m | grep -q 'sqlsrv' \ && php -m | grep -q 'pdo_sqlsrv' \ ;fi \ @@ -801,9 +791,7 @@ RUN if [ ${INSTALL_DUSK_DEPS} = true ]; then \ # Check PHP version: ########################################################################### -ARG PHP_VERSION=${PHP_VERSION} - -RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}." +RUN php -v | head -n 1 | grep -q "PHP ${LARADOCK_PHP_VERSION}." # #-------------------------------------------------------------------------- From 303dadf33dcfa9e1e07405c60dfc6e05d402117c Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Sun, 29 Jul 2018 12:42:13 +0800 Subject: [PATCH 08/19] fix ln: failed to create symbolic link: file exists. (#1735) #1707 --- php-fpm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 45b91d2f..2fb86df8 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -423,7 +423,7 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql17 locales \ && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ # link local aliases - && ln -s /etc/locale.alias /usr/share/locale/locale.alias \ + && ln -sfn /etc/locale.alias /usr/share/locale/locale.alias \ && locale-gen \ # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. && pecl install pdo_sqlsrv sqlsrv \ From 8180804ae0b0c731415174d6a8e9261f07b33161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dgor=20Jaca=C3=BAna?= Date: Sun, 29 Jul 2018 01:07:15 -0400 Subject: [PATCH 09/19] Add Metabase for analytics and Business Intelligence (#1711) * Include metabase service * Removing unecessary environment variables * Update documentation --- DOCUMENTATION/content/documentation/index.md | 13 +++++++++++++ docker-compose.yml | 13 +++++++++++++ env-example | 5 +++++ 3 files changed, 31 insertions(+) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 4135df41..73e5990b 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -555,6 +555,19 @@ docker-compose up -d netdata 2 - Open your browser and visit the localhost on port **19999**: `http://localhost:19999` +
+ +## Use Metabase + +1 - Run the Metabase Container (`metbase`) with the `docker-compose up` command. Example: + +```bash +docker-compose up -d metabase +``` + +2 - Open your browser and visit the localhost on port **3030**: `http://localhost:3030` + +3 - You can use environment to configure Metabase container. See docs in: [Running Metabase on Docker](https://www.metabase.com/docs/v0.12.0/operations-guide/running-metabase-on-docker.html) diff --git a/docker-compose.yml b/docker-compose.yml index f865989a..e1a6f18c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -876,3 +876,16 @@ services: - backend depends_on: - mongo + +### Metabase ################################################# + metabase: + image: metabase/metabase:latest + environment: + - MB_DB_FILE=/metabase-data/${METABASE_DB_FILE} + ports: + - ${METABASE_PORT}:3000 + volumes: + - ${DATA_PATH_HOST}/metabase-data:/metabase-data + networks: + - backend + diff --git a/env-example b/env-example index b928a8e0..513425c6 100644 --- a/env-example +++ b/env-example @@ -402,3 +402,8 @@ MONGO_WEBUI_PORT=3000 MONGO_WEBUI_ROOT_URL=http://localhost MONGO_WEBUI_MONGO_URL=mongodb://mongo:27017/ MONGO_WEBUI_INSTALL_MONGO=false + +### METABASE ############################################### +METABASE_PORT=3030 +METABASE_DB_FILE=metabase.db +METABASE_JAVA_TIMEZONE=US/Pacific \ No newline at end of file From 1b865dd153818643b2bbab685dd7a2155e2ae9fc Mon Sep 17 00:00:00 2001 From: "Shao Yu-Lung (Allen)" Date: Tue, 31 Jul 2018 22:38:02 +0800 Subject: [PATCH 10/19] fix php5.6 workspace aerospike travis-ci build failed. (#1738) --- env-example | 4 +++- travis-build.sh | 4 ++++ workspace/Dockerfile | 22 ++++++++++++++++------ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/env-example b/env-example index 513425c6..15f55b8d 100644 --- a/env-example +++ b/env-example @@ -336,6 +336,8 @@ AEROSPIKE_INFO_PORT=3003 # for all versions "https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz" # for php 7.2 (using this branch until the support for 7.2 on master) "https://github.com/aerospike/aerospike-client-php/archive/7.2.0-release-candidate.tar.gz" AEROSPIKE_PHP_REPOSITORY=https://github.com/aerospike/aerospike-client-php/archive/7.2.0-release-candidate.tar.gz +# for php 5.6 +# AEROSPIKE_PHP_REPOSITORY=https://github.com/aerospike/aerospike-client-php5/archive/3.4.15.tar.gz ### RETHINKDB ############################################# @@ -406,4 +408,4 @@ MONGO_WEBUI_INSTALL_MONGO=false ### METABASE ############################################### METABASE_PORT=3030 METABASE_DB_FILE=metabase.db -METABASE_JAVA_TIMEZONE=US/Pacific \ No newline at end of file +METABASE_JAVA_TIMEZONE=US/Pacific diff --git a/travis-build.sh b/travis-build.sh index d6aec972..eeee67ba 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -15,6 +15,10 @@ if [ -n "${PHP_VERSION}" ]; then sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env sed -i -- 's/=false/=true/g' .env sed -i -- 's/PHPDBG=true/PHPDBG=false/g' .env + if [ "${PHP_VERSION}" == "5.6" ]; then + sed -i -- 's/^AEROSPIKE_PHP_REPOSITORY=/##AEROSPIKE_PHP_REPOSITORY=/g' .env + sed -i -- 's/^# AEROSPIKE_PHP_REPOSITORY=/AEROSPIKE_PHP_REPOSITORY=/g' .env + fi cat .env docker-compose build ${BUILD_SERVICE} docker images diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 60c6cdb1..2a639f11 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -493,12 +493,22 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ curl -L -o /tmp/aerospike-client-php.tar.gz ${AEROSPIKE_PHP_REPOSITORY} \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ - && ( \ - cd aerospike-client-php/src \ - && phpize \ - && ./build.sh \ - && make install \ - ) \ + && \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + ( \ + cd aerospike-client-php/src/aerospike \ + && phpize \ + && ./build.sh \ + && make install \ + ) \ + else \ + ( \ + cd aerospike-client-php/src \ + && phpize \ + && ./build.sh \ + && make install \ + ) \ + fi \ && rm /tmp/aerospike-client-php.tar.gz \ && echo 'extension=aerospike.so' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \ && echo 'aerospike.udf.lua_system_path=/usr/local/aerospike/lua' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \ From 89051de67daba1825bad9dff8c9e31cf796131e1 Mon Sep 17 00:00:00 2001 From: Youri Westerman Date: Tue, 21 Aug 2018 12:41:34 +0700 Subject: [PATCH 11/19] This developer needed to turn back the clock in the PHP-FPM container, you will not believe what he did next! (#1675) * Added documentation for installing libfaketime in the php-fpm container * Enabled installing and using libfaketime system-wide inside the php-fpm container --- DOCUMENTATION/content/documentation/index.md | 23 ++++++++++++++++++++ docker-compose.yml | 2 ++ env-example | 2 ++ php-fpm/Dockerfile | 18 +++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 73e5990b..9370110e 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -1499,10 +1499,33 @@ e) set it to `true` 3 - Set it to `true`
4 - Re-build the containers `docker-compose build php-fpm` +
+
+ +## Install libfaketime in the php-fpm container +Libfaketime allows you to control the date and time that is returned from the operating system. +It can be used by specifying a special string in the `PHP_FPM_FAKETIME` variable in the `.env` file. +For example: +`PHP_FPM_FAKETIME=-1d` +will set the clock back 1 day. See (https://github.com/wolfcw/libfaketime) for more information. + +1 - Open the `.env` file +
+2 - Search for the `PHP_FPM_INSTALL_FAKETIME` argument under the PHP-FPM container +
+3 - Set it to `true` +
+4 - Search for the `PHP_FPM_FAKETIME` argument under the PHP-FPM container +
+5 - Set it to the desired string +
+6 - Re-build the containers `docker-compose build php-fpm`
+ +
diff --git a/docker-compose.yml b/docker-compose.yml index e1a6f18c..dd595843 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -144,6 +144,7 @@ services: - INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS} - INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK} - INSTALL_CALENDAR=${PHP_FPM_INSTALL_CALENDAR} + - INSTALL_FAKETIME=${PHP_FPM_INSTALL_FAKETIME} volumes: - ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} @@ -154,6 +155,7 @@ services: environment: - PHP_IDE_CONFIG=${PHP_IDE_CONFIG} - DOCKER_HOST=tcp://docker-in-docker:2375 + - FAKETIME=${PHP_FPM_FAKETIME} depends_on: - workspace networks: diff --git a/env-example b/env-example index 15f55b8d..bad6e1d1 100644 --- a/env-example +++ b/env-example @@ -149,6 +149,8 @@ PHP_FPM_INSTALL_SWOOLE=false PHP_FPM_INSTALL_PG_CLIENT=false PHP_FPM_INSTALL_PCNTL=false PHP_FPM_INSTALL_CALENDAR=false +PHP_FPM_INSTALL_FAKETIME=false +PHP_FPM_FAKETIME=-0 ### PHP_WORKER ############################################ diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 2fb86df8..71586807 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -485,6 +485,18 @@ RUN if [ ${INSTALL_CALENDAR} = true ]; then \ docker-php-ext-install calendar \ ;fi +########################################################################### +# libfaketime: +########################################################################### + +USER root + +ARG INSTALL_FAKETIME=false + +RUN if [ ${INSTALL_FAKETIME} = true ]; then \ + apt-get install -y libfaketime \ +;fi + ########################################################################### # Check PHP version: ########################################################################### @@ -509,6 +521,12 @@ RUN apt-get clean && \ RUN usermod -u 1000 www-data +# Adding the faketime library to the preload file needs to be done last +# otherwise it will preload it for all commands that follow in this file +RUN if [ ${INSTALL_FAKETIME} = true ]; then \ + echo "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1" > /etc/ld.so.preload \ +;fi + WORKDIR /var/www CMD ["php-fpm"] From b788a8bbfda5395ad7a42f5607c7d9a68ea3e837 Mon Sep 17 00:00:00 2001 From: ahkui <14049597+ahkui@users.noreply.github.com> Date: Tue, 21 Aug 2018 13:49:56 +0800 Subject: [PATCH 12/19] Add Web Based IDEs (#1705) Add Web Based IDEs: Theia, WebIDE, Codaid, IceCoder. --- docker-compose.yml | 56 +++++++++++++++++++++++++++++++++++++++++ env-example | 6 +++++ ide-codiad/Dockerfile | 5 ++++ ide-codiad/config.php | 43 +++++++++++++++++++++++++++++++ ide-icecoder/Dockerfile | 21 ++++++++++++++++ ide-theia/Dockerfile | 5 ++++ ide-webide/Dockerfile | 3 +++ 7 files changed, 139 insertions(+) create mode 100644 ide-codiad/Dockerfile create mode 100644 ide-codiad/config.php create mode 100644 ide-icecoder/Dockerfile create mode 100644 ide-theia/Dockerfile create mode 100644 ide-webide/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index dd595843..9541eb49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -891,3 +891,59 @@ services: networks: - backend +### IDE-THEIA ################################################ + ide-theia: + build: + context: ./ide-theia + volumes: + - ${APP_CODE_PATH_HOST}:/home/project + ports: + - "${IDE_THEIA_PORT}:3000" + networks: + - backend + +### IDE-WEBIDE ################################################ + ide-webide: + build: + context: ./ide-webide + volumes: + - ${DATA_PATH_HOST}/ide/webide/ide.db:/root/.coding-ide/ide.db + ports: + - "${IDE_WEBIDE_PORT}:8080" + networks: + - backend + +### IDE-CODIAD ################################################ + ide-codiad: + build: + context: ./ide-codiad + environment: + - APP_CODE_PATH_CONTAINER=${APP_CODE_PATH_CONTAINER} + - TZ=${WORKSPACE_TIMEZONE} + - PGID=1000 + - PUID=1000 + volumes: + - /etc/localtime:/etc/localtime:ro + - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} + - ${DATA_PATH_HOST}/ide/codiad:/config + ports: + - "${IDE_CODIAD_PORT}:80" + networks: + - backend + +### IDE-ICECODER ################################################ + ide-icecoder: + build: + context: ./ide-icecoder + environment: + - DOCUMENT_ROOT=${APP_CODE_PATH_CONTAINER} + - TZ=${WORKSPACE_TIMEZONE} + - PGID=1000 + - PUID=1000 + volumes: + - /etc/localtime:/etc/localtime:ro + - ${APP_CODE_PATH_HOST}:/home/laradock/ICEcoder/dev + ports: + - "${IDE_ICECODER_PORT}:8080" + networks: + - backend diff --git a/env-example b/env-example index bad6e1d1..0b727829 100644 --- a/env-example +++ b/env-example @@ -411,3 +411,9 @@ MONGO_WEBUI_INSTALL_MONGO=false METABASE_PORT=3030 METABASE_DB_FILE=metabase.db METABASE_JAVA_TIMEZONE=US/Pacific + +### IDE ############################################### +IDE_THEIA_PORT=987 +IDE_WEBIDE_PORT=984 +IDE_CODIAD_PORT=985 +IDE_ICECODER_PORT=986 diff --git a/ide-codiad/Dockerfile b/ide-codiad/Dockerfile new file mode 100644 index 00000000..583e75dc --- /dev/null +++ b/ide-codiad/Dockerfile @@ -0,0 +1,5 @@ +FROM linuxserver/codiad + +LABEL maintainer="ahkui " + +COPY config.php /defaults/config.php diff --git a/ide-codiad/config.php b/ide-codiad/config.php new file mode 100644 index 00000000..acd43941 --- /dev/null +++ b/ide-codiad/config.php @@ -0,0 +1,43 @@ + \ No newline at end of file diff --git a/ide-icecoder/Dockerfile b/ide-icecoder/Dockerfile new file mode 100644 index 00000000..a58ec677 --- /dev/null +++ b/ide-icecoder/Dockerfile @@ -0,0 +1,21 @@ +FROM php:alpine + +LABEL maintainer="ahkui " + +ARG PUID=1000 +ENV PUID ${PUID} +ARG PGID=1000 +ENV PGID ${PGID} + +RUN apk add --no-cache git + +RUN addgroup -g $PGID -S laradock && \ + adduser -u $PUID -S laradock -G laradock + +USER laradock + +RUN cd /home/laradock && git clone https://github.com/mattpass/ICEcoder.git + +WORKDIR /home/laradock/ICEcoder + +CMD ["php","-S","0.0.0.0:8080"] diff --git a/ide-theia/Dockerfile b/ide-theia/Dockerfile new file mode 100644 index 00000000..39f2c1b6 --- /dev/null +++ b/ide-theia/Dockerfile @@ -0,0 +1,5 @@ +FROM theiaide/theia + +LABEL maintainer="ahkui " + +RUN echo 'fs.inotify.max_user_watches=524288' >> /etc/sysctl.conf \ No newline at end of file diff --git a/ide-webide/Dockerfile b/ide-webide/Dockerfile new file mode 100644 index 00000000..257b50a7 --- /dev/null +++ b/ide-webide/Dockerfile @@ -0,0 +1,3 @@ +FROM webide/webide + +LABEL maintainer="ahkui " From aa84dd861636e191463fe009267a8365e0100cfe Mon Sep 17 00:00:00 2001 From: vladyslavstartsev Date: Tue, 21 Aug 2018 14:01:12 +0300 Subject: [PATCH 13/19] added ext-gmp to workspace container (#1762) --- docker-compose.yml | 1 + env-example | 1 + workspace/Dockerfile | 14 ++++++++++++++ 3 files changed, 16 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 9541eb49..aa7badf1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,7 @@ services: - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} - INSTALL_PHPDBG=${WORKSPACE_INSTALL_PHPDBG} - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} + - INSTALL_GMP=${WORKSPACE_INSTALL_GMP} - INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP} - INSTALL_LDAP=${WORKSPACE_INSTALL_LDAP} - INSTALL_IMAP=${WORKSPACE_INSTALL_IMAP} diff --git a/env-example b/env-example index 0b727829..6378c0b6 100644 --- a/env-example +++ b/env-example @@ -89,6 +89,7 @@ WORKSPACE_INSTALL_SUBVERSION=false WORKSPACE_INSTALL_XDEBUG=false WORKSPACE_INSTALL_PHPDBG=false WORKSPACE_INSTALL_LDAP=false +WORKSPACE_INSTALL_GMP=false WORKSPACE_INSTALL_SOAP=false WORKSPACE_INSTALL_IMAP=false WORKSPACE_INSTALL_MONGO=false diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 2a639f11..0030d953 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -180,6 +180,20 @@ RUN if [ ${INSTALL_DRUSH} = true ]; then \ USER root +ARG INSTALL_GMP=false +ARG PHP_VERSION=${PHP_VERSION} + +RUN if [ ${INSTALL_GMP} = true ]; then \ + # Install the PHP SOAP extension + apt-get -y install php${PHP_VERSION}-gmp \ +;fi + +########################################################################### +# SOAP: +########################################################################### + +USER root + ARG INSTALL_SOAP=false RUN if [ ${INSTALL_SOAP} = true ]; then \ From 947a791ad2feb8e42f49325d9ca3f06db3451420 Mon Sep 17 00:00:00 2001 From: ahkui <14049597+ahkui@users.noreply.github.com> Date: Sun, 26 Aug 2018 16:02:55 +0800 Subject: [PATCH 14/19] Auto reload caddy and add basicauth example (#1706) * add live reload and basicauth --- caddy/Dockerfile | 8 +++++--- caddy/{ => caddy}/Caddyfile | 5 +++++ caddy/caddy/authlist.conf | 1 + docker-compose.yml | 2 +- env-example | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) rename caddy/{ => caddy}/Caddyfile (93%) create mode 100644 caddy/caddy/authlist.conf diff --git a/caddy/Dockerfile b/caddy/Dockerfile index 5603e3a1..06dc4901 100644 --- a/caddy/Dockerfile +++ b/caddy/Dockerfile @@ -6,12 +6,14 @@ ARG plugins="cors" ## ARG plugins="cors cgi cloudflare azure linode" - RUN caddyplug install ${plugins} - + +RUN apk add --no-cache inotify-tools \ + && echo -e "#!/bin/sh\nwhile inotifywait -e modify /etc/caddy; do\n\tpkill caddy\ndone " >> /start.sh \ + && chmod +x /start.sh EXPOSE 80 443 2015 WORKDIR /var/www/public -CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile","-agree"] +CMD ["sh","-c","/start.sh & /usr/bin/caddy -conf /etc/caddy/Caddyfile -agree"] diff --git a/caddy/Caddyfile b/caddy/caddy/Caddyfile similarity index 93% rename from caddy/Caddyfile rename to caddy/caddy/Caddyfile index b563fb15..1848d346 100644 --- a/caddy/Caddyfile +++ b/caddy/caddy/Caddyfile @@ -44,3 +44,8 @@ laradock2.demo:80 { #proxy domain.com #cors } + +laradock3.demo:80 { + import authlist.conf + root /var/www/public +} \ No newline at end of file diff --git a/caddy/caddy/authlist.conf b/caddy/caddy/authlist.conf new file mode 100644 index 00000000..651bf55e --- /dev/null +++ b/caddy/caddy/authlist.conf @@ -0,0 +1 @@ +basicauth / laradock laradock diff --git a/docker-compose.yml b/docker-compose.yml index aa7badf1..920f57d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -471,7 +471,7 @@ services: build: ./caddy volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} - - ${CADDY_CUSTOM_CADDYFILE}:/etc/Caddyfile + - ${CADDY_CONFIG_PATH}:/etc/caddy - ${CADDY_HOST_LOG_PATH}:/var/log/caddy - ${DATA_PATH_HOST}:/root/.caddy ports: diff --git a/env-example b/env-example index 6378c0b6..c851395c 100644 --- a/env-example +++ b/env-example @@ -355,7 +355,7 @@ MONGODB_PORT=27017 CADDY_HOST_HTTP_PORT=80 CADDY_HOST_HTTPS_PORT=443 CADDY_HOST_LOG_PATH=./logs/caddy -CADDY_CUSTOM_CADDYFILE=./caddy/Caddyfile +CADDY_CONFIG_PATH=./caddy/caddy ### LARAVEL ECHO SERVER ################################### From 39469e1404172d2d833b9eb9f0fb4665624815df Mon Sep 17 00:00:00 2001 From: vladyslavstartsev Date: Tue, 28 Aug 2018 09:16:25 +0300 Subject: [PATCH 15/19] added ssh2 to workspace and php-fpm (#1756) --- docker-compose.yml | 2 ++ env-example | 2 ++ php-fpm/Dockerfile | 17 +++++++++++++++++ workspace/Dockerfile | 13 +++++++++++++ 4 files changed, 34 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 920f57d9..61f261b9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,7 @@ services: - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} - INSTALL_PHPDBG=${WORKSPACE_INSTALL_PHPDBG} - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} + - INSTALL_SSH2=${WORKSPACE_INSTALL_SSH2} - INSTALL_GMP=${WORKSPACE_INSTALL_GMP} - INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP} - INSTALL_LDAP=${WORKSPACE_INSTALL_LDAP} @@ -120,6 +121,7 @@ services: - INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG} - INSTALL_PHPDBG=${PHP_FPM_INSTALL_PHPDBG} - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} + - INSTALL_SSH2=${PHP_FPM_INSTALL_SSH2} - INSTALL_SOAP=${PHP_FPM_INSTALL_SOAP} - INSTALL_IMAP=${PHP_FPM_INSTALL_IMAP} - INSTALL_MONGO=${PHP_FPM_INSTALL_MONGO} diff --git a/env-example b/env-example index c851395c..6089cdcd 100644 --- a/env-example +++ b/env-example @@ -88,6 +88,7 @@ WORKSPACE_INSTALL_WORKSPACE_SSH=false WORKSPACE_INSTALL_SUBVERSION=false WORKSPACE_INSTALL_XDEBUG=false WORKSPACE_INSTALL_PHPDBG=false +WORKSPACE_INSTALL_SSH2=false WORKSPACE_INSTALL_LDAP=false WORKSPACE_INSTALL_GMP=false WORKSPACE_INSTALL_SOAP=false @@ -139,6 +140,7 @@ PHP_FPM_INSTALL_IMAP=false PHP_FPM_INSTALL_MONGO=false PHP_FPM_INSTALL_AMQP=false PHP_FPM_INSTALL_MSSQL=false +PHP_FPM_INSTALL_SSH2=false PHP_FPM_INSTALL_SOAP=false PHP_FPM_INSTALL_GMP=false PHP_FPM_INSTALL_EXIF=false diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 71586807..e1b4c45f 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -50,6 +50,23 @@ RUN apt-get update -yqq && \ # - INSTALL_ZIP_ARCHIVE=true # +########################################################################### +# SSH2: +########################################################################### + +ARG INSTALL_SSH2=false + +RUN if [ ${INSTALL_SSH2} = true ]; then \ + # Install the ssh2 extension + apt-get -y install libssh2-1-dev && \ + if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ + pecl install -a ssh2-0.13; \ + else \ + pecl install -a ssh2-1.1.2; \ + fi && \ + docker-php-ext-enable ssh2 \ +;fi + ########################################################################### # SOAP: ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 0030d953..37f1fb1b 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -174,6 +174,19 @@ RUN if [ ${INSTALL_DRUSH} = true ]; then \ drush core-status \ ;fi +########################################################################### +# SSH2: +########################################################################### + +USER root + +ARG INSTALL_SSH2=false + +RUN if [ ${INSTALL_SSH2} = true ]; then \ + # Install the PHP SSH2 extension + apt-get -y install libssh2-1-dev php${LARADOCK_PHP_VERSION}-ssh2 \ +;fi + ########################################################################### # SOAP: ########################################################################### From 2e2cb6df227aef83285e627bada59320606674da Mon Sep 17 00:00:00 2001 From: Tatamo Date: Fri, 31 Aug 2018 21:19:52 +0900 Subject: [PATCH 16/19] Enable `docker-compose exec workspace npm` (and yarn, etc.) (#1743) * fix node PATH to enable docker-compose exec workspace npm * add PATH for yarn to enable docker-compose exec workspace yarn --- workspace/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 37f1fb1b..dd22fef3 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -448,6 +448,7 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ && if [ ${INSTALL_NPM_VUE_CLI} = true ]; then \ npm install -g @vue/cli \ ;fi \ + && ln -s `npm bin --global` /home/laradock/.node-bin \ ;fi # Wouldn't execute when added to the RUN statement in the above block @@ -468,7 +469,7 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ ;fi # Add PATH for node -ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin +ENV PATH $PATH:/home/laradock/.node-bin RUN if [ ${NPM_REGISTRY} ]; then \ . ~/.bashrc && npm config set registry ${NPM_REGISTRY} \ @@ -504,6 +505,9 @@ RUN if [ ${INSTALL_YARN} = true ]; then \ echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \ ;fi +# Add PATH for YARN +ENV PATH $PATH:/home/laradock/.yarn/bin + ########################################################################### # PHP Aerospike: ########################################################################### From 902198ab05cd5e6f90c2f9bdd389ca2266a30f30 Mon Sep 17 00:00:00 2001 From: tadaken3 Date: Sat, 8 Sep 2018 20:42:58 +0900 Subject: [PATCH 17/19] fix application path (#1781) * fix application path In the "env.sample" , "APP_CODE_PATH_HOST" was written. I fixed Documentation. --- DOCUMENTATION/content/getting-started/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DOCUMENTATION/content/getting-started/index.md b/DOCUMENTATION/content/getting-started/index.md index bca083e6..a067fa30 100644 --- a/DOCUMENTATION/content/getting-started/index.md +++ b/DOCUMENTATION/content/getting-started/index.md @@ -81,10 +81,10 @@ We'll need to do step 1 of the [Usage](#Usage) section now to make this happen. cp env-example .env ``` -At the top, change the `APPLICATION` variable to your project path. +At the top, change the `APP_CODE_PATH_HOST` variable to your project path. ``` -APPLICATION=../project-z/ +APP_CODE_PATH_HOST=../project-z/ ``` Make sure to replace `project-z` with your project folder name. From 00df369e9655a28a3178f8f3bc569be00adda5be Mon Sep 17 00:00:00 2001 From: ganlei <769323213@qq.com> Date: Sat, 8 Sep 2018 21:31:05 +0800 Subject: [PATCH 18/19] =?UTF-8?q?Add=20IonCube=20Loader=20=EF=BC=88zend=5F?= =?UTF-8?q?extension=EF=BC=89=20(#1763)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOCUMENTATION/content/documentation/index.md | 22 ++++++++++++++++++++ docker-compose.yml | 2 ++ env-example | 2 ++ php-fpm/Dockerfile | 15 +++++++++++++ workspace/Dockerfile | 15 +++++++++++++ 5 files changed, 56 insertions(+) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 9370110e..b3e22943 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -353,6 +353,28 @@ Note: If `.php-fpm/xdebug` doesn't execute and gives `Permission Denied` error t +
+ +## Install ionCube Loader + +1 - First install `ionCube Loader` in the Workspace and the PHP-FPM Containers: +
+a) open the `.env` file +
+b) search for the `WORKSPACE_INSTALL_IONCUBE` argument under the Workspace Container +
+c) set it to `true` +
+d) search for the `PHP_FPM_INSTALL_IONCUBE` argument under the PHP-FPM Container +
+e) set it to `true` + +2 - Re-build the containers `docker-compose build workspace php-fpm` + +Always download the latest version of [Loaders for ionCube ](http://www.ioncube.com/loaders.php). + + +
diff --git a/docker-compose.yml b/docker-compose.yml index 61f261b9..a944795d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -90,6 +90,7 @@ services: - INSTALL_PG_CLIENT=${WORKSPACE_INSTALL_PG_CLIENT} - INSTALL_SWOOLE=${WORKSPACE_INSTALL_SWOOLE} - INSTALL_LIBPNG=${WORKSPACE_INSTALL_LIBPNG} + - INSTALL_IONCUBE=${WORKSPACE_INSTALL_IONCUBE} - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} - CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION} @@ -148,6 +149,7 @@ services: - INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK} - INSTALL_CALENDAR=${PHP_FPM_INSTALL_CALENDAR} - INSTALL_FAKETIME=${PHP_FPM_INSTALL_FAKETIME} + - INSTALL_IONCUBE=${PHP_FPM_INSTALL_IONCUBE} volumes: - ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER} diff --git a/env-example b/env-example index 6089cdcd..1e5b4758 100644 --- a/env-example +++ b/env-example @@ -116,6 +116,7 @@ WORKSPACE_INSTALL_DUSK_DEPS=false WORKSPACE_INSTALL_PG_CLIENT=false WORKSPACE_INSTALL_SWOOLE=false WORKSPACE_INSTALL_LIBPNG=false +WORKSPACE_INSTALL_IONCUBE=false WORKSPACE_PUID=1000 WORKSPACE_PGID=1000 WORKSPACE_CHROME_DRIVER_VERSION=2.32 @@ -153,6 +154,7 @@ PHP_FPM_INSTALL_PG_CLIENT=false PHP_FPM_INSTALL_PCNTL=false PHP_FPM_INSTALL_CALENDAR=false PHP_FPM_INSTALL_FAKETIME=false +PHP_FPM_INSTALL_IONCUBE=false PHP_FPM_FAKETIME=-0 ### PHP_WORKER ############################################ diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index e1b4c45f..dd7f0d15 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -342,6 +342,21 @@ RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ && docker-php-ext-enable aerospike \ ;fi +########################################################################### +# IonCube Loader: +########################################################################### + +ARG INSTALL_IONCUBE=false + +RUN if [ ${INSTALL_IONCUBE} = true ]; then \ + # Install the php ioncube loader + curl -L -o /tmp/ioncube_loaders_lin_x86-64.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ + && tar zxpf /tmp/ioncube_loaders_lin_x86-64.tar.gz -C /tmp \ + && mv /tmp/ioncube/ioncube_loader_lin_${LARADOCK_PHP_VERSION}.so $(php -r "echo ini_get('extension_dir');")/ioncube_loader.so \ + && printf "zend_extension=ioncube_loader.so\n" > $PHP_INI_DIR/conf.d/0ioncube.ini \ + && rm -rf /tmp/ioncube* \ +;fi + ########################################################################### # Opcache: ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index dd22fef3..2ce90784 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -397,6 +397,21 @@ RUN if [ ${INSTALL_LIBPNG} = true ]; then \ apt install libpng16-16 \ ;fi +########################################################################### +# IonCube Loader +########################################################################### + +ARG INSTALL_IONCUBE=false + +RUN if [ ${INSTALL_IONCUBE} = true ]; then \ + # Install the php ioncube loader + curl -L -o /tmp/ioncube_loaders_lin_x86-64.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ + && tar zxpf /tmp/ioncube_loaders_lin_x86-64.tar.gz -C /tmp \ + && mv /tmp/ioncube/ioncube_loader_lin_${LARADOCK_PHP_VERSION}.so $(php -r "echo ini_get('extension_dir');")/ioncube_loader.so \ + && echo "zend_extension=ioncube_loader.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/0ioncube.ini \ + && rm -rf /tmp/ioncube* \ +;fi + ########################################################################### # Drupal Console: ########################################################################### From 876935452ec75fb19f75fef386234dc38e7c78de Mon Sep 17 00:00:00 2001 From: ThunderbirdsX3 Date: Sat, 8 Sep 2018 20:31:58 +0700 Subject: [PATCH 19/19] Add .gitignore to php-worker (#1780) * Add .gitignore * Change file to example. --- php-worker/supervisord.d/.gitignore | 1 + .../{laravel-worker.conf => laravel-worker.conf.example} | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 php-worker/supervisord.d/.gitignore rename php-worker/supervisord.d/{laravel-worker.conf => laravel-worker.conf.example} (89%) diff --git a/php-worker/supervisord.d/.gitignore b/php-worker/supervisord.d/.gitignore new file mode 100644 index 00000000..fee92170 --- /dev/null +++ b/php-worker/supervisord.d/.gitignore @@ -0,0 +1 @@ +*.conf diff --git a/php-worker/supervisord.d/laravel-worker.conf b/php-worker/supervisord.d/laravel-worker.conf.example similarity index 89% rename from php-worker/supervisord.d/laravel-worker.conf rename to php-worker/supervisord.d/laravel-worker.conf.example index cce9e923..06156bc5 100644 --- a/php-worker/supervisord.d/laravel-worker.conf +++ b/php-worker/supervisord.d/laravel-worker.conf.example @@ -4,4 +4,4 @@ command=php /var/www/artisan queue:work --sleep=3 --tries=3 --daemon autostart=true autorestart=true numprocs=8 -redirect_stderr=true \ No newline at end of file +redirect_stderr=true