From 12506682670c7cb4fbac4c309d329fc2d6799960 Mon Sep 17 00:00:00 2001 From: Ignacio Cabrera Date: Tue, 14 Mar 2017 10:47:10 -0300 Subject: [PATCH 01/12] Adding MSSQL Support --- php-fpm/Dockerfile-70 | 72 +++++++++++++++++++++++++++++++++++++++++++ php-fpm/laravel.ini | 3 ++ 2 files changed, 75 insertions(+) diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index 20aaf5a9..391bb734 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -186,6 +186,78 @@ RUN if [ ${CODEIGNITER} = true ]; then \ docker-php-ext-install tokenizer \ ;fi +##################################### +# SQL SERVER: +##################################### +ARG MSSQL=false +RUN if [ ${MSSQL} = true ]; then \ + + ##################################### + # Install Depenencies: + ##################################### + apt-get update && \ + apt-get install -y --force-yes wget apt-transport-https curl freetds-common php5-odbc libsybdb5 freetds-bin unixodbc unixodbc-dev php5-sybase && \ + + ##################################### + # The following steps were taken from + # Microsoft's github account: + # https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-getting-pdo_sqlsrv-for-PHP-7.0-on-Debian-in-3-ways + ##################################### + + # Add PHP 7 repository + # for Debian jessie + # And System upgrade + echo "deb http://packages.dotdeb.org jessie all" \ + | tee /etc/apt/sources.list.d/dotdeb.list \ + && wget -qO- https://www.dotdeb.org/dotdeb.gpg \ + | apt-key add - \ + && apt-get update \ + && apt-get upgrade -qq && \ + + # Install UnixODBC + # Compile odbc_config as it is not part of unixodbc package + apt-get install -y whiptail \ + unixodbc libgss3 odbcinst devscripts debhelper dh-exec dh-autoreconf libreadline-dev libltdl-dev \ + && dget -u -x http://http.debian.net/debian/pool/main/u/unixodbc/unixodbc_2.3.1-3.dsc \ + && cd unixodbc-*/ \ + && dpkg-buildpackage -uc -us -B -d \ + && cp -v ./exe/odbc_config /usr/local/bin/ && \ + + # Fake uname for install.sh + printf '#!/bin/bash\nif [ "$*" == "-p" ]; then echo "x86_64"; else /bin/uname "$@"; fi' \ + | tee /usr/local/bin/uname \ + && chmod +x /usr/local/bin/uname && \ + + # Microsoft ODBC Driver 13 for Linux + # Note: There's a copy of this tar on my hubiC + wget -nv -O msodbcsql-13.0.0.0.tar.gz \ + "https://meetsstorenew.blob.core.windows.net/contianerhd/Ubuntu%2013.0%20Tar/msodbcsql-13.0.0.0.tar.gz?st=2016-10-18T17%3A29%3A00Z&se=2022-10-19T17%3A29%3A00Z&sp=rl&sv=2015-04-05&sr=b&sig=cDwPfrouVeIQf0vi%2BnKt%2BzX8Z8caIYvRCmicDL5oknY%3D" \ + && tar -xf msodbcsql-13.0.0.0.tar.gz \ + && cd msodbcsql-*/ \ + && ldd lib64/libmsodbcsql-13.0.so.0.0 \ + && ./install.sh install --accept-license \ + && ls -l /opt/microsoft/msodbcsql/ \ + && odbcinst -q -d -n "ODBC Driver 13 for SQL Server" && \ + + + ##################################### + # Install sqlsrv y pdo_sqlsrv + # extensions: + ##################################### + + pecl install sqlsrv-4.0.6 && \ + pecl install pdo_sqlsrv-4.0.6 && \ + + ##################################### + # Set locales for the container + ##################################### + + apt-get install -y locales \ + && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ + && locale-gen \ +;fi + + # #-------------------------------------------------------------------------- # Final Touch diff --git a/php-fpm/laravel.ini b/php-fpm/laravel.ini index 486a2cab..fdf70e71 100644 --- a/php-fpm/laravel.ini +++ b/php-fpm/laravel.ini @@ -11,3 +11,6 @@ upload_max_filesize = 20M ; Sets max size of post data allowed. ; http://php.net/post-max-size post_max_size = 20M +; Enables the MSSQL extensions +extension=sqlsrv.so +extension=pdo_sqlsrv.so \ No newline at end of file From 246814874ccd187e618e8977449b0562a0625ec5 Mon Sep 17 00:00:00 2001 From: Ignacio Cabrera Date: Tue, 14 Mar 2017 10:49:44 -0300 Subject: [PATCH 02/12] Adding Arg to docker-compose --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 283d7770..5ef43a57 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -61,6 +61,7 @@ services: - INSTALL_EXIF=false - INSTALL_AEROSPIKE_EXTENSION=false - CODEIGNITER=false + - MSSQL=false dockerfile: Dockerfile-70 volumes_from: - applications From 0c53eadf348f7b3636ed2f0ae35741d199c14f69 Mon Sep 17 00:00:00 2001 From: Marius van Zundert Date: Fri, 17 Mar 2017 16:55:53 +0100 Subject: [PATCH 03/12] docker-71 file now also works with new env-example setup --- php-fpm/Dockerfile-71 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/php-fpm/Dockerfile-71 b/php-fpm/Dockerfile-71 index 065a32fb..96804fd3 100644 --- a/php-fpm/Dockerfile-71 +++ b/php-fpm/Dockerfile-71 @@ -130,13 +130,19 @@ RUN if [ ${INSTALL_OPCACHE} = true ]; then \ COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini ##################################### -# Codeigniter Modifications: +# Mysqli Modifications: +##################################### +ARG INSTALL_MYSQLI=false +RUN if [ ${INSTALL_MYSQLI} = true ]; then \ + docker-php-ext-install mysqli \ +;fi + +##################################### +# Tokenizer Modifications: ##################################### -ARG CODEIGNITER=false -RUN if [ ${CODEIGNITER} = true ]; then \ - # Install Codeigniter PHP extentions requirements - docker-php-ext-install mysqli && \ +ARG INSTALL_TOKENIZER=false +RUN if [ ${INSTALL_TOKENIZER} = true ]; then \ docker-php-ext-install tokenizer \ ;fi From 4b2ddfad2001e2cd1abc4246a9c11e7a6a05a929 Mon Sep 17 00:00:00 2001 From: Marius van Zundert Date: Fri, 17 Mar 2017 19:32:45 +0100 Subject: [PATCH 04/12] Updated project example confs to not have gitignore issues --- nginx/sites/{project-1.conf => project-1.conf-example} | 0 nginx/sites/{project-2.conf => project-2-conf-example} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename nginx/sites/{project-1.conf => project-1.conf-example} (100%) rename nginx/sites/{project-2.conf => project-2-conf-example} (100%) diff --git a/nginx/sites/project-1.conf b/nginx/sites/project-1.conf-example similarity index 100% rename from nginx/sites/project-1.conf rename to nginx/sites/project-1.conf-example diff --git a/nginx/sites/project-2.conf b/nginx/sites/project-2-conf-example similarity index 100% rename from nginx/sites/project-2.conf rename to nginx/sites/project-2-conf-example From 4588685e9707cfa512821946a40d4a9b2954e4ab Mon Sep 17 00:00:00 2001 From: Marius van Zundert Date: Fri, 17 Mar 2017 19:34:32 +0100 Subject: [PATCH 05/12] Updated project example confs to fit nameing convention used in apache example --- nginx/sites/{project-1.conf-example => project-1.conf.example} | 0 nginx/sites/{project-2-conf-example => project-2.conf.example} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename nginx/sites/{project-1.conf-example => project-1.conf.example} (100%) rename nginx/sites/{project-2-conf-example => project-2.conf.example} (100%) diff --git a/nginx/sites/project-1.conf-example b/nginx/sites/project-1.conf.example similarity index 100% rename from nginx/sites/project-1.conf-example rename to nginx/sites/project-1.conf.example diff --git a/nginx/sites/project-2-conf-example b/nginx/sites/project-2.conf.example similarity index 100% rename from nginx/sites/project-2-conf-example rename to nginx/sites/project-2.conf.example From 69c180d2e842995e58cc4cf2b878c2127b9d55fd Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:01:16 +0800 Subject: [PATCH 06/12] use CREATE USER to define account authentication characteristics --- mysql/startup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/startup b/mysql/startup index 320c8bba..4cd6356a 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ -DROP USER IF EXISTS 'MYSQL_USER'; +DROP USER IF EXISTS 'MYSQL_USER' IDENTIFIED BY 'MYSQL_PASSWORD'; CREATE USER 'MYSQL_USER'@'%'; CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; -GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; +GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%'; From d94de05fd4594411e8e30ae8fe31d94579bd5baa Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:06:45 +0800 Subject: [PATCH 07/12] use CREATE USER to define account authentication characteristics --- mysql/startup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql/startup b/mysql/startup index 4cd6356a..e813a12d 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ -DROP USER IF EXISTS 'MYSQL_USER' IDENTIFIED BY 'MYSQL_PASSWORD'; -CREATE USER 'MYSQL_USER'@'%'; +DROP USER IF EXISTS 'MYSQL_USER'; +CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%'; From 570be592bbf57139e16159b0cb22bce367347f6d Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:36:58 +0800 Subject: [PATCH 08/12] use '`' to quote identifier --- mysql/startup | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql/startup b/mysql/startup index e813a12d..863b93cb 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ -DROP USER IF EXISTS 'MYSQL_USER'; -CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; -CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; -GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%'; +DROP USER IF EXISTS 'MYSQL_USER'; +CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; +CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`; +GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; \ No newline at end of file From bdcc2adf3fa19ac90eb621a5adf39e5b5e8ef059 Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:40:07 +0800 Subject: [PATCH 09/12] for file format --- mysql/startup | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql/startup b/mysql/startup index 863b93cb..2fd16455 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ -DROP USER IF EXISTS 'MYSQL_USER'; -CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; -CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`; -GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; \ No newline at end of file +DROP USER IF EXISTS 'MYSQL_USER'; +CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; +CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`; +GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; From 1650af04cd8e4b73cd5f8d64a51bd9d388abe339 Mon Sep 17 00:00:00 2001 From: spuch Date: Mon, 20 Mar 2017 15:41:03 +0800 Subject: [PATCH 10/12] align file format --- mysql/startup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql/startup b/mysql/startup index 2fd16455..0a82f1dc 100644 --- a/mysql/startup +++ b/mysql/startup @@ -1,4 +1,4 @@ DROP USER IF EXISTS 'MYSQL_USER'; CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`; -GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; +GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%'; From 8869b22a1d464e0f169422fcf0ecd6500fdaa721 Mon Sep 17 00:00:00 2001 From: Thor Erik Lie Date: Mon, 20 Mar 2017 10:33:25 +0100 Subject: [PATCH 11/12] fixes up so Yarn is installable again --- docker-compose.yml | 16 ++++++++-------- env-example | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 92892ee0..4034dbdf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: workspace: build: context: ./workspace - args: + args: - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} - INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP} - INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO} @@ -32,7 +32,7 @@ services: - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} - NODE_VERSION=${WORKSPACE_NODE_VERSION} - - YARN_VERSION=${WORKSPACE_TIMEZONE} + - YARN_VERSION=${WORKSPACE_YARN_VERSION} - TZ=${WORKSPACE_TIMEZONE} volumes_from: - applications @@ -57,7 +57,7 @@ services: - INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED} - INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE} - INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF} - - INSTALL_AEROSPIKE_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION} + - INSTALL_AEROSPIKE_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION} - INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI} - INSTALL_TOKENIZER=${PHP_FPM_INSTALL_TOKENIZER} - INSTALL_INTL=${PHP_FPM_INSTALL_INTL} @@ -72,7 +72,7 @@ services: - "dockerhost:${DOCKER_HOST_IP}" environment: - PHP_IDE_CONFIG=${PHP_IDE_CONFIG} - + ### PHP Worker Container ##################################### php-worker: build: @@ -91,7 +91,7 @@ services: - PHP_UPSTREAM=php-fpm volumes_from: - applications - volumes: + volumes: - ${NGINX_HOST_LOG_PATH}:/var/log/nginx - ${NGINX_SITES_PATH}:/etc/nginx/sites-available ports: @@ -112,7 +112,7 @@ services: volumes: - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 - ./apache2/sites:/etc/apache2/sites-available - + ports: - "${APACHE_HOST_HTTP_PORT}:80" @@ -349,9 +349,9 @@ services: - "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300" depends_on: - php-fpm - + ### Certbot Container ################################## - + certbot: build: context: ./certbot diff --git a/env-example b/env-example index 35ce745f..7d5b154a 100644 --- a/env-example +++ b/env-example @@ -28,6 +28,7 @@ WORKSPACE_INSTALL_MC=false WORKSPACE_PUID=1000 WORKSPACE_PGID=1000 WORKSPACE_NODE_VERSION=stable +WORKSPACE_YARN_VERSION=latest WORKSPACE_TIMEZONE=UTC WORKSPACE_SSH_PORT=2222 From c6e9b1ed5df797ddaecce1a42c44e36485e87dc1 Mon Sep 17 00:00:00 2001 From: Marius van Zundert Date: Tue, 21 Mar 2017 11:21:26 +0100 Subject: [PATCH 12/12] Fixed path variable for windows users --- env-example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/env-example b/env-example index 7d5b154a..8b24deec 100644 --- a/env-example +++ b/env-example @@ -1,3 +1,6 @@ +# Fix for windows users to make sure the application path works. +COMPOSE_CONVERT_WINDOWS_PATHS=1 + ### Application # Point to your application code, wish should be available at `/var/www`