From c4d7086c364cbac590d2db2d300b7b03e86e3bfb Mon Sep 17 00:00:00 2001 From: data Date: Tue, 27 Dec 2016 17:58:58 +0100 Subject: [PATCH 01/29] changed mailcatcher docker image to https://hub.docker.com/r/schickling/mailcatcher/ --- docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 899e03c..dfd1dca 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -69,7 +69,7 @@ services: #mailcatcher mailcatcher: container_name: "sf_mailcatcher" - image: yappabe/mailcatcher + image: schickling/mailcatcher ports: - 1025:1025 - 1080:1080 From 9800b4437661b74cecdd9f21406b80001b991622 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 27 Dec 2016 21:08:59 +0100 Subject: [PATCH 02/29] removing apache-php dir. --- docker/apache-php/000-default.conf | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 docker/apache-php/000-default.conf diff --git a/docker/apache-php/000-default.conf b/docker/apache-php/000-default.conf deleted file mode 100644 index 79782c3..0000000 --- a/docker/apache-php/000-default.conf +++ /dev/null @@ -1,30 +0,0 @@ - - # The ServerName directive sets the request scheme, hostname and port that - # the server uses to identify itself. This is used when creating - # redirection URLs. In the context of virtual hosts, the ServerName - # specifies what hostname must appear in the request's Host: header to - # match this virtual host. For the default virtual host (this file) this - # value is not decisive as it is used as a last resort host regardless. - # However, you must set it for any further virtual host explicitly. - #ServerName www.example.com - - ServerAdmin webmaster@localhost - DocumentRoot /var/www/html/web - DirectoryIndex app_dev.php - - # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, - # error, crit, alert, emerg. - # It is also possible to configure the loglevel for particular - # modules, e.g. - #LogLevel info ssl:warn - - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined - - # For most configuration files from conf-available/, which are - # enabled or disabled at a global level, it is possible to - # include a line for only one particular virtual host. For example the - # following line enables the CGI configuration for this host only - # after it has been globally disabled with "a2disconf". - #Include conf-available/serve-cgi-bin.conf - From 5dfa27e8b031495d0598ccfe7fc36bdafae105b6 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 10:23:51 +0100 Subject: [PATCH 03/29] working ondrej repos and composer --- docker/sf_web/Dockerfile.dist | 106 ++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 42 deletions(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index a57dafe..c9771fb 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -1,69 +1,91 @@ -FROM php:7-apache +FROM ubuntu:xenial -#Enable necessary Apache modules -RUN a2enmod rewrite +LABEL com.example.version="1-beta" +LABEL vendor="nerdpress.org" +LABEL org.nerdpress.release-date="2016-12-28" +LABEL or.nerdpress.version.is-production="false" -#Change your timezone below. Full list of timezones: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones -RUN echo Europe/Berlin > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata +ENV DEBIAN_FRONTEND noninteractive #Append software required during runtime here. -RUN RUNTIME_PKGS="locales zsh curl vim git zip mcrypt mysql-client htop ssh-client libicu52 libjpeg62-turbo libpng12-0 libfreetype6" \ - && apt-get update && apt-get install -y --no-install-recommends $RUNTIME_PKGS \ +RUN BASE_PKGS="ca-certificates locales zsh curl vim git zip mcrypt htop ssh-client" \ + && apt-get update && apt-get install -y --no-install-recommends $BASE_PKGS \ && apt-get autoremove -y && apt-get clean -y \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - + +#Change your timezone below. Full list of timezones: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +RUN echo Europe/Berlin > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata + +#Add Ondrej Sury PPAs (https://launchpad.net/~ondrej) and install Apache+PHP +RUN WEB_PKGS="apache2 nghttp2 php7.0 php7.0-mysql php-xdebug php-zip php-curl libapache2-mod-php7.0" \ + && echo deb http://ppa.launchpad.net/ondrej/apache2/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-apache2.list \ + && echo deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-php.list \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-key E5267A6C \ + && apt-get update && apt-get install -y --no-install-recommends $WEB_PKGS \ + && apt-get autoremove -y && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + + +#libapache2-mod-php7.0 php7.0-cl php7.0-common php7.0-gd php7.0-intl php7.0-json php7.0-xml php7.0-xsl php7.0-zip php7.0-mbstring php7.0-mcrypt php7.0-opcache php-apcu + +#### +#RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/* + +#Enable necessary Apache modules +RUN a2enmod rewrite + #PECL ADD docker-php-pecl-install /usr/local/bin/ RUN chmod u+x /usr/local/bin/docker-php-pecl-install #Append software required during build here. -RUN BUILD_PKGS="zlib1g-dev libicu-dev g++ libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev make" \ - && apt-get update && apt-get install -y --no-install-recommends $BUILD_PKGS \ - && docker-php-ext-install -j$(nproc) iconv mcrypt mbstring exif zip opcache pdo_mysql pcntl \ - && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ - && docker-php-ext-install -j$(nproc) gd \ - && docker-php-ext-configure intl \ - && docker-php-ext-install intl \ - && docker-php-pecl-install xdebug \ - && apt-get autoremove -y $BUILD_PKGS \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +#RUN BUILD_PKGS="zlib1g-dev libicu-dev g++ libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev make" \ +# && apt-get update && apt-get install -y --no-install-recommends $BUILD_PKGS \ +# && docker-php-ext-install -j$(nproc) iconv mcrypt mbstring exif zip opcache pdo_mysql pcntl \ +# && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ +# && docker-php-ext-install -j$(nproc) gd \ +# && docker-php-ext-configure intl \ +# && docker-php-ext-install intl \ +# && docker-php-pecl-install xdebug \ +# && apt-get autoremove -y $BUILD_PKGS \ +# && apt-get clean -y \ +# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* #Configure xdebug. -RUN sed -i '1 a xdebug.remote_autostart=true' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini -RUN sed -i '1 a xdebug.remote_connect_back=1 ' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini -RUN sed -i '1 a xdebug.remote_enable=1' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini -RUN sed -i '1 a xdebug.max_nesting_level = 1200' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini +#RUN sed -i '1 a xdebug.remote_autostart=true' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini +#RUN sed -i '1 a xdebug.remote_connect_back=1 ' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini +#RUN sed -i '1 a xdebug.remote_enable=1' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini +#RUN sed -i '1 a xdebug.max_nesting_level = 1200' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini #Install blackfire. -RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ - && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ - && mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so \ - && echo "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707" > /usr/local/etc/php/conf.d/blackfire.ini \ - && rm -rf /tmp/* /var/tmp/* +#RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ +# && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ +# && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ +# && mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so \ +# && echo "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707" > /usr/local/etc/php/conf.d/blackfire.ini \ +# && rm -rf /tmp/* /var/tmp/* #Install composer. RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ - && composer global require hirak/prestissimo \ - && rm -rf /tmp/* /var/tmp/* + && composer global require hirak/prestissimo \ + && rm -rf /tmp/* /var/tmp/* -#Populate Environment -COPY 000-default.conf /etc/apache2/sites-available/000-default.conf -COPY php.ini /usr/local/etc/php/ -COPY zshrc.dist /var/www/.zshrc +##Populate Environment +#COPY 000-default.conf /etc/apache2/sites-available/000-default.conf +#COPY php.ini /usr/local/etc/php/ +#COPY zshrc.dist /var/www/.zshrc #Overtake www-data -RUN usermod -u $USER_ID www-data -s /bin/zsh +#RUN usermod -u $USER_ID www-data -s /bin/zsh #Install oh-my-zsh -ENV TERM=xterm -RUN git clone git://github.com/robbyrussell/oh-my-zsh.git /var/www/.oh-my-zsh +#ENV TERM=xterm +#RUN git clone git://github.com/robbyrussell/oh-my-zsh.git /var/www/.oh-my-zsh #Fix permissions and umask -RUN chgrp -R www-data /var/www -RUN chmod -R g+rwx /var/www -RUN umask 0007 +#RUN chgrp -R www-data /var/www +#RUN chmod -R g+rwx /var/www +#RUN umask 0007 -WORKDIR /var/www/html \ No newline at end of file +#WORKDIR /var/www/html \ No newline at end of file From abd0c532a3e2e705f95ad488a307133e0f6573cc Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 10:56:23 +0100 Subject: [PATCH 04/29] - --- docker/sf_web/Dockerfile.dist | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index c9771fb..eaea8ad 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -6,6 +6,7 @@ LABEL org.nerdpress.release-date="2016-12-28" LABEL or.nerdpress.version.is-production="false" ENV DEBIAN_FRONTEND noninteractive +ENV PHP_VERSION 7.0.14 #Append software required during runtime here. RUN BASE_PKGS="ca-certificates locales zsh curl vim git zip mcrypt htop ssh-client" \ @@ -72,20 +73,21 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local && rm -rf /tmp/* /var/tmp/* ##Populate Environment -#COPY 000-default.conf /etc/apache2/sites-available/000-default.conf -#COPY php.ini /usr/local/etc/php/ -#COPY zshrc.dist /var/www/.zshrc +COPY 000-default.conf /etc/apache2/sites-available/000-default.conf +COPY php.ini /usr/local/etc/php/ #Overtake www-data #RUN usermod -u $USER_ID www-data -s /bin/zsh #Install oh-my-zsh -#ENV TERM=xterm -#RUN git clone git://github.com/robbyrussell/oh-my-zsh.git /var/www/.oh-my-zsh +ENV TERM=xterm +RUN git clone git://github.com/robbyrussell/oh-my-zsh.git /var/www/.oh-my-zsh #Fix permissions and umask #RUN chgrp -R www-data /var/www #RUN chmod -R g+rwx /var/www #RUN umask 0007 -#WORKDIR /var/www/html \ No newline at end of file +EXPOSE 80 +WORKDIR /var/www/html +ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] \ No newline at end of file From 3e4b8e3e0bf84d4d6ac81572f3eeae610f4cc403 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 11:32:36 +0100 Subject: [PATCH 05/29] basic symfony working. --- docker/sf_web/Dockerfile.dist | 49 ++++++++++------------------------- 1 file changed, 13 insertions(+), 36 deletions(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index eaea8ad..b30e43a 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -19,7 +19,7 @@ RUN BASE_PKGS="ca-certificates locales zsh curl vim git zip mcrypt htop ssh-clie RUN echo Europe/Berlin > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata #Add Ondrej Sury PPAs (https://launchpad.net/~ondrej) and install Apache+PHP -RUN WEB_PKGS="apache2 nghttp2 php7.0 php7.0-mysql php-xdebug php-zip php-curl libapache2-mod-php7.0" \ +RUN WEB_PKGS="apache2 nghttp2 php7.0 php7.0-mysql php-xdebug php-zip php-json php-curl php-xml libapache2-mod-php7.0" \ && echo deb http://ppa.launchpad.net/ondrej/apache2/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-apache2.list \ && echo deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-php.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-key E5267A6C \ @@ -27,32 +27,9 @@ RUN WEB_PKGS="apache2 nghttp2 php7.0 php7.0-mysql php-xdebug php-zip php-curl li && apt-get autoremove -y && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -#libapache2-mod-php7.0 php7.0-cl php7.0-common php7.0-gd php7.0-intl php7.0-json php7.0-xml php7.0-xsl php7.0-zip php7.0-mbstring php7.0-mcrypt php7.0-opcache php-apcu - -#### -#RUN apt-get update && apt-get install -y apache2-bin apache2.2-common --no-install-recommends && rm -rf /var/lib/apt/lists/* - #Enable necessary Apache modules RUN a2enmod rewrite -#PECL -ADD docker-php-pecl-install /usr/local/bin/ -RUN chmod u+x /usr/local/bin/docker-php-pecl-install - -#Append software required during build here. -#RUN BUILD_PKGS="zlib1g-dev libicu-dev g++ libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev make" \ -# && apt-get update && apt-get install -y --no-install-recommends $BUILD_PKGS \ -# && docker-php-ext-install -j$(nproc) iconv mcrypt mbstring exif zip opcache pdo_mysql pcntl \ -# && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ -# && docker-php-ext-install -j$(nproc) gd \ -# && docker-php-ext-configure intl \ -# && docker-php-ext-install intl \ -# && docker-php-pecl-install xdebug \ -# && apt-get autoremove -y $BUILD_PKGS \ -# && apt-get clean -y \ -# && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - #Configure xdebug. #RUN sed -i '1 a xdebug.remote_autostart=true' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini #RUN sed -i '1 a xdebug.remote_connect_back=1 ' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini @@ -60,12 +37,12 @@ RUN chmod u+x /usr/local/bin/docker-php-pecl-install #RUN sed -i '1 a xdebug.max_nesting_level = 1200' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini #Install blackfire. -#RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ -# && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ -# && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ -# && mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so \ -# && echo "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707" > /usr/local/etc/php/conf.d/blackfire.ini \ -# && rm -rf /tmp/* /var/tmp/* +RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ + && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ + && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ + && mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so \ + && echo "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707" > /etc/php/7.0/mods-available/blackfire.ini \ + && rm -rf /tmp/* /var/tmp/* #Install composer. RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ @@ -74,20 +51,20 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local ##Populate Environment COPY 000-default.conf /etc/apache2/sites-available/000-default.conf -COPY php.ini /usr/local/etc/php/ +#COPY php.ini /usr/local/etc/php/ #Overtake www-data -#RUN usermod -u $USER_ID www-data -s /bin/zsh +RUN usermod -u $USER_ID www-data -s /bin/zsh #Install oh-my-zsh ENV TERM=xterm RUN git clone git://github.com/robbyrussell/oh-my-zsh.git /var/www/.oh-my-zsh #Fix permissions and umask -#RUN chgrp -R www-data /var/www -#RUN chmod -R g+rwx /var/www -#RUN umask 0007 +RUN chgrp -R www-data /var/www +RUN chmod -R g+rwx /var/www +RUN umask 0007 EXPOSE 80 WORKDIR /var/www/html -ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] \ No newline at end of file +ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] From 2382f09d86a4fa3d25513eda5bddf559bc008c90 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 12:47:35 +0100 Subject: [PATCH 06/29] added sqlite and intl php packages --- docker/sf_web/Dockerfile.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index b30e43a..fbce90f 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -19,7 +19,7 @@ RUN BASE_PKGS="ca-certificates locales zsh curl vim git zip mcrypt htop ssh-clie RUN echo Europe/Berlin > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata #Add Ondrej Sury PPAs (https://launchpad.net/~ondrej) and install Apache+PHP -RUN WEB_PKGS="apache2 nghttp2 php7.0 php7.0-mysql php-xdebug php-zip php-json php-curl php-xml libapache2-mod-php7.0" \ +RUN WEB_PKGS="apache2 nghttp2 php7.0 php7.0-mysql php7.0-sqlite php7.0-intl php-xdebug php-zip php-json php-curl php-xml libapache2-mod-php7.0" \ && echo deb http://ppa.launchpad.net/ondrej/apache2/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-apache2.list \ && echo deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-php.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-key E5267A6C \ From 06db6b4ee36be314bd17ee1754dbef28939100a6 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 17:56:51 +0100 Subject: [PATCH 07/29] enabled http2 support --- docker/sf_web/000-default.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/sf_web/000-default.conf b/docker/sf_web/000-default.conf index 79782c3..2ac3892 100644 --- a/docker/sf_web/000-default.conf +++ b/docker/sf_web/000-default.conf @@ -1,3 +1,6 @@ +#This enables http2 support. h2 ist http2 via TLS, h2c is http2 via TCP,... +#The sorting order decides on the connection (left first) +Protocols h2 h2c http/1.1 # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating From 5fec36470cb626355c96de985d8e51453f3ee8d3 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 17:59:56 +0100 Subject: [PATCH 08/29] a2enmod http2 --- docker/sf_web/Dockerfile.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index fbce90f..b62c8d1 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -28,7 +28,7 @@ RUN WEB_PKGS="apache2 nghttp2 php7.0 php7.0-mysql php7.0-sqlite php7.0-intl php- && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* #Enable necessary Apache modules -RUN a2enmod rewrite +RUN a2enmod rewrite http2 #Configure xdebug. #RUN sed -i '1 a xdebug.remote_autostart=true' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini From d421192ea54c2afc78c0a81a603bb0819a86bef4 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 18:04:50 +0100 Subject: [PATCH 09/29] added sudo command and permissions. --- docker/sf_web/Dockerfile.dist | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index b62c8d1..8071269 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND noninteractive ENV PHP_VERSION 7.0.14 #Append software required during runtime here. -RUN BASE_PKGS="ca-certificates locales zsh curl vim git zip mcrypt htop ssh-client" \ +RUN BASE_PKGS="ca-certificates locales zsh curl vim git zip mcrypt htop ssh-client sudo" \ && apt-get update && apt-get install -y --no-install-recommends $BASE_PKGS \ && apt-get autoremove -y && apt-get clean -y \ && locale-gen en_US.UTF-8 \ @@ -53,8 +53,8 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local COPY 000-default.conf /etc/apache2/sites-available/000-default.conf #COPY php.ini /usr/local/etc/php/ -#Overtake www-data -RUN usermod -u $USER_ID www-data -s /bin/zsh +#Overtake www-data, set zsh shell, append (!) groups sudo and adm +RUN usermod -u $USER_ID www-data -s /bin/zsh -a -G sudo,adm #Install oh-my-zsh ENV TERM=xterm From dd8bd2133de35b2a624414276db583551fceeafd Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 18:19:39 +0100 Subject: [PATCH 10/29] working sudo command for www-data user. --- docker/sf_web/Dockerfile.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index 8071269..3318f86 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -55,6 +55,7 @@ COPY 000-default.conf /etc/apache2/sites-available/000-default.conf #Overtake www-data, set zsh shell, append (!) groups sudo and adm RUN usermod -u $USER_ID www-data -s /bin/zsh -a -G sudo,adm +RUN echo "www-data ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers #Install oh-my-zsh ENV TERM=xterm From 53e272be8ac98f76db8d998fe4ea28fa0ad53e8a Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 21:28:13 +0100 Subject: [PATCH 11/29] removed docker pecl scripts --- docker/sf_web/docker-php-pecl-install | 36 --------------------------- 1 file changed, 36 deletions(-) delete mode 100644 docker/sf_web/docker-php-pecl-install diff --git a/docker/sf_web/docker-php-pecl-install b/docker/sf_web/docker-php-pecl-install deleted file mode 100644 index 1062439..0000000 --- a/docker/sf_web/docker-php-pecl-install +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -set -e - -usage() { - echo "usage: $0 [channel/] ..." - echo " ie: $0 uploadprogress oauth-1.2.3" -} - -if [ $# -eq 0 ]; then - usage >&2 - exit 1 -fi - -pecl install "$@" - -while [ $# -gt 0 ]; do - ext="$1" - ext=$(echo "$ext" | cut -d- -f1) - ext=$(echo "$ext" | cut -d\/ -f2) - shift - - for module in $(find /usr/local/lib/php/extensions -name "$ext.so"); do - ini="/usr/local/etc/php/conf.d/docker-php-pecl-$ext.ini" - if grep -q zend_extension_entry "$module"; then - # https://wiki.php.net/internals/extensions#loading_zend_extensions - line="zend_extension=$(basename "$module")" - else - line="extension=$(basename "$module")" - fi - if ! grep -q "$line" "$ini" 2>/dev/null; then - echo "$line" >> "$ini" - fi - done -done - -rm -rf /tmp/* From 73892a02c33170d6e54da720450740e7c8cb4ad0 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 22:26:31 +0100 Subject: [PATCH 12/29] README changes. --- README.md | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index ce3a65d..d035bf5 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ permission-hassle free :tm: [» More](/Resources/doc/permissions.md) git clone https://github.com/nerdpress-org/docker-sf3.git docker-sf3 cp -r docker-sf3/docker /path/to/your/symfony-project/ +## Please Notice + + This software compilation is ment for local development purpose only. + ## Usage cd /path/to/your/symfony-project/docker @@ -32,34 +36,46 @@ Open the browser: [http://[docker-host]:8080](http://[docker-host]:8080) ![toolbar](Resources/doc/toolbar.png) -### PHP -PHP7 is used. +## PHP7 on Apache 2.4 (http2 enabled) + +from the [https://launchpad.net/~ondrej](Ondřej Surý PPA) +running on Ubuntu:Xenial. + +### Debugging & Tools. Xdebug and Blackfire.io support are included by default. [» How to configure](Resources/doc/debug.md) -### DB + [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) is the default shell. -MySql is used. +## DB +Official MySQL Docker [https://hub.docker.com/r/mysql/mysql-server/](mysql:5) is used. Use the name of the service as the database host in your connection settings: -```yml -database_driver: pdo_mysql -database_host: db -database_port: 3306 -database_name: sf3 -database_user: sf3 -database_password: sf3 -``` + ```yml + database_driver: pdo_mysql + database_host: db + database_port: 3306 + database_name: sf3 + database_user: sf3 + database_password: sf3 + ``` -Its configured to be open for access from outside, -so if you prefer to use MySql Workbench on the host, use the containers IP as host. -Find the IP with: `docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' $(docker ps -q)` + Its configured to be open for access from outside, + so if you prefer to use MySql Workbench on the host, use the containers IP as host. + Find the IP with: `docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' $(docker ps -q)` -Otherwise use phpmyadmin on [http://[docker-host]:8081](http://[docker-host]:8081) +# Otherwise use phpmyadmin on [http://[docker-host]:8081](http://[docker-host]:8081) ### Other Services * [Elasticsearch](Resources/doc/services.md) * [Mailcatcher SMTP](Resources/doc/services.md) + +### settings +Locale is en_US.UTF-8 +Timezone is set to Europe/Berlin + + + From f121dc9695112427476cce4ca2c9b22796578cb8 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 22:29:30 +0100 Subject: [PATCH 13/29] README format --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d035bf5..2e56a06 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ running on Ubuntu:Xenial. Xdebug and Blackfire.io support are included by default. [» How to configure](Resources/doc/debug.md) - [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) is the default shell. +[oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) is the default shell. ## DB Official MySQL Docker [https://hub.docker.com/r/mysql/mysql-server/](mysql:5) is used. @@ -62,11 +62,12 @@ Use the name of the service as the database host in your connection settings: database_password: sf3 ``` - Its configured to be open for access from outside, - so if you prefer to use MySql Workbench on the host, use the containers IP as host. - Find the IP with: `docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' $(docker ps -q)` +Its configured to be open for access from outside, +so if you prefer to use MySql Workbench on the host, use the containers IP as host. +Find the IP with: + `docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' $(docker ps -q)` -# Otherwise use phpmyadmin on [http://[docker-host]:8081](http://[docker-host]:8081) +### Otherwise use official phpmyadmin docker on [http://[docker-host]:8081](http://[docker-host]:8081) ### Other Services From 0f155415d63d8582a0ad93883c2d8c75aa630724 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 22:30:14 +0100 Subject: [PATCH 14/29] - --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e56a06..583233a 100644 --- a/README.md +++ b/README.md @@ -53,14 +53,14 @@ Xdebug and Blackfire.io support are included by default. Official MySQL Docker [https://hub.docker.com/r/mysql/mysql-server/](mysql:5) is used. Use the name of the service as the database host in your connection settings: - ```yml +```yml database_driver: pdo_mysql database_host: db database_port: 3306 database_name: sf3 database_user: sf3 database_password: sf3 - ``` +``` Its configured to be open for access from outside, so if you prefer to use MySql Workbench on the host, use the containers IP as host. From f86bb7396a37483e9b94edab8594622c2ea9dfda Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 22:38:32 +0100 Subject: [PATCH 15/29] format. --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 583233a..e6030bd 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Open the browser: [http://[docker-host]:8080](http://[docker-host]:8080) ## PHP7 on Apache 2.4 (http2 enabled) from the [https://launchpad.net/~ondrej](Ondřej Surý PPA) -running on Ubuntu:Xenial. +running on [https://hub.docker.com/_/ubuntu/](Ubuntu:Xenial) Docker Image. ### Debugging & Tools. @@ -49,8 +49,12 @@ Xdebug and Blackfire.io support are included by default. [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) is the default shell. +The Dockerfile can be found here: +https://github.com/datadarius/docker-sf3/tree/ubuntu/docker/sf_web + + ## DB -Official MySQL Docker [https://hub.docker.com/r/mysql/mysql-server/](mysql:5) is used. +Official (https://hub.docker.com/r/mysql/mysql-server/)[MySQL:5] Docker is used. Use the name of the service as the database host in your connection settings: ```yml @@ -74,7 +78,9 @@ Find the IP with: * [Elasticsearch](Resources/doc/services.md) * [Mailcatcher SMTP](Resources/doc/services.md) -### settings + +###Customizing Environment +TODO Locale is en_US.UTF-8 Timezone is set to Europe/Berlin From d1fb33d9328537c8cf2b1ad09dc20ee11e3fdeb0 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Dec 2016 23:06:22 +0100 Subject: [PATCH 16/29] documentation debug and services. --- Resources/doc/debug.md | 12 +++++++++++- Resources/doc/services.md | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Resources/doc/debug.md b/Resources/doc/debug.md index 5c2d585..f9b3991 100644 --- a/Resources/doc/debug.md +++ b/Resources/doc/debug.md @@ -22,4 +22,14 @@ Blackfire client and agent are provided by the official Docker image. The probe is integrated in the PHP container. Get the Blackfire Bookmarklet and enter your credentials in *docker-env* and thats it. -Happy Profiling :) \ No newline at end of file +Happy Profiling :) + +## Switching between Blackfire and Xdebug + +Do not run xdebug and blackfire simoultanously. +In order ot enable or disable xdebug / blackfire, please run + +```yml +sudo phpdismod xdebug +sudo phpenmod blackfire +``` diff --git a/Resources/doc/services.md b/Resources/doc/services.md index 705d6e6..2c352f5 100644 --- a/Resources/doc/services.md +++ b/Resources/doc/services.md @@ -1,13 +1,13 @@ -#### Elasticsearch - +### Elasticsearch +Uses the official [https://hub.docker.com/_/elasticsearch](Elasticsearch Alpine) image. ```yml host: elasticsearch port: 9200 ``` -#### Mailcatcher SMTP - +### Mailcatcher SMTP +[mailcatcher](https://rubygems.org/gems/mailcatcher/) helps to deal with inbound and outbound email. ```yml host: mailcatcher port: 1025 From 138f7824a7b7588884041547902e5821491d51d5 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 29 Dec 2016 00:56:03 +0100 Subject: [PATCH 17/29] added various references --- README.md | 6 +++--- Resources/doc/services.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e6030bd..7f798a7 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ Open the browser: [http://[docker-host]:8080](http://[docker-host]:8080) ## PHP7 on Apache 2.4 (http2 enabled) -from the [https://launchpad.net/~ondrej](Ondřej Surý PPA) -running on [https://hub.docker.com/_/ubuntu/](Ubuntu:Xenial) Docker Image. +from the [Ondřej Surý PPA](https://launchpad.net/~ondrej) +running on [Ubuntu:Xenial](https://hub.docker.com/_/ubuntu/) Docker Image. ### Debugging & Tools. @@ -54,7 +54,7 @@ https://github.com/datadarius/docker-sf3/tree/ubuntu/docker/sf_web ## DB -Official (https://hub.docker.com/r/mysql/mysql-server/)[MySQL:5] Docker is used. +Official [MySQL:5](https://hub.docker.com/r/mysql/mysql-server/) Docker is used. Use the name of the service as the database host in your connection settings: ```yml diff --git a/Resources/doc/services.md b/Resources/doc/services.md index 2c352f5..9d41a91 100644 --- a/Resources/doc/services.md +++ b/Resources/doc/services.md @@ -1,6 +1,6 @@ ### Elasticsearch -Uses the official [https://hub.docker.com/_/elasticsearch](Elasticsearch Alpine) image. +Uses the official [Elasticsearch Alpine](https://hub.docker.com/_/elasticsearch) image. ```yml host: elasticsearch port: 9200 From 87f52c0bad117292bc9129478de3fceca3ae8e1b Mon Sep 17 00:00:00 2001 From: data Date: Thu, 29 Dec 2016 14:20:53 +0100 Subject: [PATCH 18/29] label corrections --- docker/sf_web/Dockerfile.dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index 3318f86..fe68bdd 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -1,9 +1,9 @@ FROM ubuntu:xenial -LABEL com.example.version="1-beta" +LABEL org.nerdpress.version="1-beta" LABEL vendor="nerdpress.org" LABEL org.nerdpress.release-date="2016-12-28" -LABEL or.nerdpress.version.is-production="false" +LABEL org.nerdpress.version.is-production="false" ENV DEBIAN_FRONTEND noninteractive ENV PHP_VERSION 7.0.14 From 2eebe5f6fb4b69e76e4aba96129cfeba0055f198 Mon Sep 17 00:00:00 2001 From: data Date: Sun, 1 Jan 2017 21:05:21 +0100 Subject: [PATCH 19/29] added nerdpress zsh theme file. --- docker/docker-compose.yml | 1 + docker/sf_web/nerdpress.zsh-theme | 7 +++++++ docker/sf_web/zshrc.dist | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 docker/sf_web/nerdpress.zsh-theme diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index dfd1dca..6ac595a 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -16,6 +16,7 @@ services: - "../:/var/www/html" - "~/.composer:/var/www/.composer" - ./sf_web/zshrc.dist:/var/www/.zshrc:ro + - ./sf_web/nerdpress.zsh-theme:/var/www/.oh-my-zsh/themes/nerdpress.zsh-theme:ro links: - db - elasticsearch diff --git a/docker/sf_web/nerdpress.zsh-theme b/docker/sf_web/nerdpress.zsh-theme new file mode 100644 index 0000000..9d109dd --- /dev/null +++ b/docker/sf_web/nerdpress.zsh-theme @@ -0,0 +1,7 @@ +local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" +PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%}$(git_prompt_info) @$HOST# ' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗" +ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" \ No newline at end of file diff --git a/docker/sf_web/zshrc.dist b/docker/sf_web/zshrc.dist index 1841782..5a79d91 100644 --- a/docker/sf_web/zshrc.dist +++ b/docker/sf_web/zshrc.dist @@ -10,7 +10,7 @@ export ZSH=/var/www/.oh-my-zsh # Set name of the theme to load. Optionally, if you set this to "random" # it'll load a random theme each time that oh-my-zsh is loaded. # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -ZSH_THEME="robbyrussell" +ZSH_THEME="nerdpress" # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" From 1f4ef4ce4feba20901d8142b867815d671bec7d6 Mon Sep 17 00:00:00 2001 From: data Date: Sun, 1 Jan 2017 21:54:10 +0100 Subject: [PATCH 20/29] described zsh and permissions, added bash option. --- Resources/doc/permissions.md | 8 +++++++- Resources/doc/zsh.md | 11 +++++++++++ docker/sf_web/Dockerfile.dist | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 Resources/doc/zsh.md diff --git a/Resources/doc/permissions.md b/Resources/doc/permissions.md index 2cf762b..b2d60af 100644 --- a/Resources/doc/permissions.md +++ b/Resources/doc/permissions.md @@ -5,4 +5,10 @@ by changing the user id of the _www-data_ user to the current host user id. This should work on linux, mac or windows systems. -For running symfony commands via cli, log into the _sf_web_ container as _www-data_ \ No newline at end of file +For running symfony commands via cli, log into the _sf_web_ container as _www-data_ + +## Warning +The user www-data is member of the sudo group as well as adm. +Furthermore sudo does not require a password for the sudo action. (See sf_web/Dockerfile.dist) +This is only to simplify local development. +Do not run this on a server, please. diff --git a/Resources/doc/zsh.md b/Resources/doc/zsh.md new file mode 100644 index 0000000..d18d380 --- /dev/null +++ b/Resources/doc/zsh.md @@ -0,0 +1,11 @@ +## Nerdpress loves oh-my-zsh with rubyrussell Theme + +_zsh_ is set as the default shell. +The [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) Framework is enabled be default. +robyrussell is our favorite theme but we needed a hostname at the prompt. +Therefore whe modified the [» Theme](/sf_web/nerdpress.zsh-theme) +A few Aliases to simplify web development are configured in [» zshrc.dist](/sf_web/zshrc.dist) + + +## Enable bash +If you prefer bash, you need to edit the docker.sh and replace zsh with bash \ No newline at end of file diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index fe68bdd..45d898b 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND noninteractive ENV PHP_VERSION 7.0.14 #Append software required during runtime here. -RUN BASE_PKGS="ca-certificates locales zsh curl vim git zip mcrypt htop ssh-client sudo" \ +RUN BASE_PKGS="ca-certificates locales zsh bash curl vim git zip mcrypt htop ssh-client sudo" \ && apt-get update && apt-get install -y --no-install-recommends $BASE_PKGS \ && apt-get autoremove -y && apt-get clean -y \ && locale-gen en_US.UTF-8 \ From 2d98109b23f0d2380c0d5b8990a2fca261de0ea3 Mon Sep 17 00:00:00 2001 From: data Date: Sun, 1 Jan 2017 22:11:27 +0100 Subject: [PATCH 21/29] doku. --- README.md | 33 +++++++++++++++++++++++---------- docker/sf_web/Dockerfile.dist | 2 +- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7f798a7..e463541 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ permission-hassle free :tm: [» More](/Resources/doc/permissions.md) ## Please Notice - This software compilation is ment for local development purpose only. +This software compilation is ment for local development purpose only. ## Usage @@ -37,23 +37,24 @@ Open the browser: [http://[docker-host]:8080](http://[docker-host]:8080) ![toolbar](Resources/doc/toolbar.png) -## PHP7 on Apache 2.4 (http2 enabled) +## Development Webserver (sf_web) +_PHP7 on Apache 2.4 (http2 enabled)_ from the [Ondřej Surý PPA](https://launchpad.net/~ondrej) running on [Ubuntu:Xenial](https://hub.docker.com/_/ubuntu/) Docker Image. -### Debugging & Tools. +### Debugging Xdebug and Blackfire.io support are included by default. [» How to configure](Resources/doc/debug.md) +### zsh default shell [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) is the default shell. The Dockerfile can be found here: -https://github.com/datadarius/docker-sf3/tree/ubuntu/docker/sf_web +(/docker/sf_web Docker - -## DB +## DB (sf_db) Official [MySQL:5](https://hub.docker.com/r/mysql/mysql-server/) Docker is used. Use the name of the service as the database host in your connection settings: @@ -79,10 +80,22 @@ Find the IP with: * [Mailcatcher SMTP](Resources/doc/services.md) -###Customizing Environment -TODO -Locale is en_US.UTF-8 -Timezone is set to Europe/Berlin +### Customizing Environment +*Locale is en_US.UTF-8 +*Timezone is set to Europe/Berlin + +## ToDos + +*Create a _.htaccess_ file in the docker folder, to prevent funny things. +*Make docker_sf3 directly _installable_ into a Symfony project. +*Add more tests for the additional services. +*Tweak Nerdpress zsh theme +*Dynamically add php version to sf_web env. +*Dynamically populate db credentials for sf3 via environment. +*Set up names to enable service discovery. +*Set up automated certificate creation and clarify to make it persist. +*Create an image (e.g. on quay.io) to speed up installation. +*Set up continous image builds. (e.g. on cve or othe source images changes) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index 45d898b..d59810a 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -6,7 +6,7 @@ LABEL org.nerdpress.release-date="2016-12-28" LABEL org.nerdpress.version.is-production="false" ENV DEBIAN_FRONTEND noninteractive -ENV PHP_VERSION 7.0.14 +# Todo, set PHP_VERSION ENV through a php query. #Append software required during runtime here. RUN BASE_PKGS="ca-certificates locales zsh bash curl vim git zip mcrypt htop ssh-client sudo" \ From 30dbbb416096f300f419a50da30f06e0e2165578 Mon Sep 17 00:00:00 2001 From: data Date: Sun, 1 Jan 2017 22:28:03 +0100 Subject: [PATCH 22/29] fixed theme --- docker/sf_web/nerdpress.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/sf_web/nerdpress.zsh-theme b/docker/sf_web/nerdpress.zsh-theme index 9d109dd..8854b6c 100644 --- a/docker/sf_web/nerdpress.zsh-theme +++ b/docker/sf_web/nerdpress.zsh-theme @@ -1,5 +1,5 @@ local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" -PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%}$(git_prompt_info) @$HOST# ' +PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)@$HOST# ' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " From 96b8a0eb44af96374c4e0583ad62376a5e781baf Mon Sep 17 00:00:00 2001 From: data Date: Sun, 1 Jan 2017 22:30:47 +0100 Subject: [PATCH 23/29] format fix. --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e463541..42dc83e 100644 --- a/README.md +++ b/README.md @@ -81,21 +81,21 @@ Find the IP with: ### Customizing Environment -*Locale is en_US.UTF-8 -*Timezone is set to Europe/Berlin +* Locale is en_US.UTF-8 +* Timezone is set to Europe/Berlin ## ToDos -*Create a _.htaccess_ file in the docker folder, to prevent funny things. -*Make docker_sf3 directly _installable_ into a Symfony project. -*Add more tests for the additional services. -*Tweak Nerdpress zsh theme -*Dynamically add php version to sf_web env. -*Dynamically populate db credentials for sf3 via environment. -*Set up names to enable service discovery. -*Set up automated certificate creation and clarify to make it persist. -*Create an image (e.g. on quay.io) to speed up installation. -*Set up continous image builds. (e.g. on cve or othe source images changes) +* Create a _.htaccess_ file in the docker folder, to prevent funny things. +* Make docker_sf3 directly _installable_ into a Symfony project. +* Add more tests for the additional services. +* Tweak Nerdpress zsh theme +* Dynamically add php version to sf_web env. +* Dynamically populate db credentials for sf3 via environment. +* Set up names to enable service discovery. +* Set up automated certificate creation and clarify to make it persist. +* Create an image (e.g. on quay.io) to speed up installation. +* Set up continous image builds. (e.g. on cve or othe source images changes) From 85cc5e866151256a5a98462c2253bd39370c95e2 Mon Sep 17 00:00:00 2001 From: data Date: Sun, 1 Jan 2017 22:31:22 +0100 Subject: [PATCH 24/29] ... --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42dc83e..4f3bf1d 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Find the IP with: ### Otherwise use official phpmyadmin docker on [http://[docker-host]:8081](http://[docker-host]:8081) -### Other Services +## Other Services * [Elasticsearch](Resources/doc/services.md) * [Mailcatcher SMTP](Resources/doc/services.md) From 549987ac6db7cac56beb384a1ce2df59a80ec967 Mon Sep 17 00:00:00 2001 From: data Date: Sun, 1 Jan 2017 22:35:23 +0100 Subject: [PATCH 25/29] documentation. --- README.md | 7 ++----- Resources/doc/services.md | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4f3bf1d..34060b1 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Open the browser: [http://[docker-host]:8080](http://[docker-host]:8080) ## Development Webserver (sf_web) -_PHP7 on Apache 2.4 (http2 enabled)_ +### PHP7 on Apache 2.4 (http2 enabled) from the [Ondřej Surý PPA](https://launchpad.net/~ondrej) running on [Ubuntu:Xenial](https://hub.docker.com/_/ubuntu/) Docker Image. @@ -80,7 +80,7 @@ Find the IP with: * [Mailcatcher SMTP](Resources/doc/services.md) -### Customizing Environment +## Customizing Environment * Locale is en_US.UTF-8 * Timezone is set to Europe/Berlin @@ -96,6 +96,3 @@ Find the IP with: * Set up automated certificate creation and clarify to make it persist. * Create an image (e.g. on quay.io) to speed up installation. * Set up continous image builds. (e.g. on cve or othe source images changes) - - - diff --git a/Resources/doc/services.md b/Resources/doc/services.md index 9d41a91..603ceea 100644 --- a/Resources/doc/services.md +++ b/Resources/doc/services.md @@ -13,4 +13,6 @@ host: mailcatcher port: 1025 ``` -Webinterface on http://[yourhost*]:1080 \ No newline at end of file +Webinterface on http://[yourhost*]:1080 + +It uses the [tiny-mailcatcher](https://github.com/datadarius/tiny-mailcatcher) Docker Image. From b495d411da7e0b77b4167d3186972a2468050d62 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 14 Feb 2017 21:54:59 +0100 Subject: [PATCH 26/29] added .htaccess in docker-sf3 root directory. --- docker/.htaccess | 1 + 1 file changed, 1 insertion(+) create mode 100644 docker/.htaccess diff --git a/docker/.htaccess b/docker/.htaccess new file mode 100644 index 0000000..a7a56f7 --- /dev/null +++ b/docker/.htaccess @@ -0,0 +1 @@ +Require all denied \ No newline at end of file From 22298b88231d43ef9150a6becda00fc239d256d1 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 14 Feb 2017 22:25:27 +0100 Subject: [PATCH 27/29] clean php 7.1 setup --- docker/sf_web/Dockerfile.dist | 8 ++++---- docker/sf_web/zshrc.dist | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index d59810a..cbeb7c0 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -2,7 +2,7 @@ FROM ubuntu:xenial LABEL org.nerdpress.version="1-beta" LABEL vendor="nerdpress.org" -LABEL org.nerdpress.release-date="2016-12-28" +LABEL org.nerdpress.release-date="2017-02-14" LABEL org.nerdpress.version.is-production="false" ENV DEBIAN_FRONTEND noninteractive @@ -19,7 +19,7 @@ RUN BASE_PKGS="ca-certificates locales zsh bash curl vim git zip mcrypt htop ssh RUN echo Europe/Berlin > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata #Add Ondrej Sury PPAs (https://launchpad.net/~ondrej) and install Apache+PHP -RUN WEB_PKGS="apache2 nghttp2 php7.0 php7.0-mysql php7.0-sqlite php7.0-intl php-xdebug php-zip php-json php-curl php-xml libapache2-mod-php7.0" \ +RUN WEB_PKGS="apache2 nghttp2 php7.1 php7.1-mysql php7.1-sqlite php7.1-intl php-xdebug php-zip php-json php-curl php-xml libapache2-mod-php7.1" \ && echo deb http://ppa.launchpad.net/ondrej/apache2/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-apache2.list \ && echo deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-php.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-key E5267A6C \ @@ -41,7 +41,7 @@ RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ && mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so \ - && echo "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707" > /etc/php/7.0/mods-available/blackfire.ini \ + && echo "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707" > /etc/php/7.1/mods-available/blackfire.ini \ && rm -rf /tmp/* /var/tmp/* #Install composer. @@ -68,4 +68,4 @@ RUN umask 0007 EXPOSE 80 WORKDIR /var/www/html -ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] +ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] \ No newline at end of file diff --git a/docker/sf_web/zshrc.dist b/docker/sf_web/zshrc.dist index 5a79d91..7e6fb6e 100644 --- a/docker/sf_web/zshrc.dist +++ b/docker/sf_web/zshrc.dist @@ -20,7 +20,7 @@ ZSH_THEME="nerdpress" # HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. -# DISABLE_AUTO_UPDATE="true" +DISABLE_AUTO_UPDATE="true" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 From fe3689e2a8ed5ad6e004703fd5c55fb5c8e68abe Mon Sep 17 00:00:00 2001 From: data Date: Tue, 14 Feb 2017 22:26:26 +0100 Subject: [PATCH 28/29] removed xdebug --- docker/sf_web/Dockerfile.dist | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index cbeb7c0..821b381 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -30,12 +30,6 @@ RUN WEB_PKGS="apache2 nghttp2 php7.1 php7.1-mysql php7.1-sqlite php7.1-intl php- #Enable necessary Apache modules RUN a2enmod rewrite http2 -#Configure xdebug. -#RUN sed -i '1 a xdebug.remote_autostart=true' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini -#RUN sed -i '1 a xdebug.remote_connect_back=1 ' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini -#RUN sed -i '1 a xdebug.remote_enable=1' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini -#RUN sed -i '1 a xdebug.max_nesting_level = 1200' /usr/local/etc/php/conf.d/docker-php-pecl-xdebug.ini - #Install blackfire. RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ From ba2f6fa75ee0da70c8de09ce28b4369411aa8b7b Mon Sep 17 00:00:00 2001 From: data Date: Tue, 14 Feb 2017 22:53:51 +0100 Subject: [PATCH 29/29] xdebug disabled, php.ini disabled. --- docker/docker-compose.yml | 3 ++- docker/sf_web/000-default.conf | 2 +- docker/sf_web/Dockerfile.dist | 4 ++-- docker/sf_web/php.ini | 14 +++++++------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 6ac595a..1ab727f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -11,7 +11,8 @@ services: container_name: "sf_web" ports: - 8080:80 #apache - - 9001:9000 #xdebug + - 8081:443 #apache secure + volumes: - "../:/var/www/html" - "~/.composer:/var/www/.composer" diff --git a/docker/sf_web/000-default.conf b/docker/sf_web/000-default.conf index 2ac3892..f24ce15 100644 --- a/docker/sf_web/000-default.conf +++ b/docker/sf_web/000-default.conf @@ -1,6 +1,6 @@ #This enables http2 support. h2 ist http2 via TLS, h2c is http2 via TCP,... #The sorting order decides on the connection (left first) -Protocols h2 h2c http/1.1 +Protocols h2c http/1.1 # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating diff --git a/docker/sf_web/Dockerfile.dist b/docker/sf_web/Dockerfile.dist index 821b381..be34714 100644 --- a/docker/sf_web/Dockerfile.dist +++ b/docker/sf_web/Dockerfile.dist @@ -19,7 +19,7 @@ RUN BASE_PKGS="ca-certificates locales zsh bash curl vim git zip mcrypt htop ssh RUN echo Europe/Berlin > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata #Add Ondrej Sury PPAs (https://launchpad.net/~ondrej) and install Apache+PHP -RUN WEB_PKGS="apache2 nghttp2 php7.1 php7.1-mysql php7.1-sqlite php7.1-intl php-xdebug php-zip php-json php-curl php-xml libapache2-mod-php7.1" \ +RUN WEB_PKGS="apache2 nghttp2 php7.1 php7.1-mysql php7.1-sqlite php7.1-intl php-zip php-json php-curl php-xml libapache2-mod-php7.1" \ && echo deb http://ppa.launchpad.net/ondrej/apache2/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-apache2.list \ && echo deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main > /etc/apt/sources.list.d/ondrej-php.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-key E5267A6C \ @@ -60,6 +60,6 @@ RUN chgrp -R www-data /var/www RUN chmod -R g+rwx /var/www RUN umask 0007 -EXPOSE 80 +EXPOSE 80 443 WORKDIR /var/www/html ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] \ No newline at end of file diff --git a/docker/sf_web/php.ini b/docker/sf_web/php.ini index 7e13a7d..4539188 100644 --- a/docker/sf_web/php.ini +++ b/docker/sf_web/php.ini @@ -1932,11 +1932,11 @@ opcache.fast_shutdown=1 ; tab-width: 4 ; End: -[Xdebug] +#[Xdebug] ;zend_extension="" -xdebug.remote_enable=1 -xdebug.remote_port=9000 -xdebug.remote_host=192.168.2.165 -xdebug.profiler_enable=1 -xdebug.profiler_output_dir="/tmp/xdebug" -xdebug.var_display_max_depth = 5; +#xdebug.remote_enable=1 +#xdebug.remote_port=9000 +#xdebug.remote_host=192.168.2.165 +#xdebug.profiler_enable=1 +#xdebug.profiler_output_dir="/tmp/xdebug" +#xdebug.var_display_max_depth = 5;