diff --git a/DOCKER.md b/DOCKER.md index 1414ad2..98c8a1a 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -6,7 +6,8 @@ - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] ### Networking @@ -163,4 +164,5 @@ docker run --name symfony --restart=always \ [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/README.md b/README.md index ca81ed8..572ef63 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ various based images for Docker - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] ## Base Image Structure @@ -80,4 +81,5 @@ you can keep same __build__ script in any project [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-apache-fpm/README.md b/pluie/alpine-apache-fpm/README.md index 3c5dc8d..86402d7 100644 --- a/pluie/alpine-apache-fpm/README.md +++ b/pluie/alpine-apache-fpm/README.md @@ -6,7 +6,8 @@ - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] Extend pluie/alpine with __apache 2.4.23__ and __php 5.6.24__ with FPM @@ -95,4 +96,5 @@ $ docker exec -it afpm "httpd -h" [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-apache-php7/README.md b/pluie/alpine-apache-php7/README.md index 4843c1d..bd8ad35 100644 --- a/pluie/alpine-apache-php7/README.md +++ b/pluie/alpine-apache-php7/README.md @@ -4,8 +4,9 @@ - [pluie/alpine][2] ( < 10 MB ) Alpine/3.4 - [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.0 + - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] @@ -92,3 +93,4 @@ $ docker exec -it php7 "httpd -h" [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-apache-php7/files.tar b/pluie/alpine-apache-php7/files.tar index 73d370b..559c3d7 100644 Binary files a/pluie/alpine-apache-php7/files.tar and b/pluie/alpine-apache-php7/files.tar differ diff --git a/pluie/alpine-apache-php7/install.d/50-fix-apache.sh b/pluie/alpine-apache-php7/install.d/50-fix-apache.sh index 59afa2e..b85c386 100755 --- a/pluie/alpine-apache-php7/install.d/50-fix-apache.sh +++ b/pluie/alpine-apache-php7/install.d/50-fix-apache.sh @@ -16,8 +16,8 @@ function a2setModule(){ sed -i "s#${scom}LoadModule $2_module modules/mod_$2.so#${rcom}LoadModule $2_module modules/mod_$2.so#" "$path" fi } -if [ ! -f /usr/lib/php ]; then - ln -s /usr/lib/php7 /usr/lib/php +if [ ! -f /usr/bin/php ]; then + ln -s /usr/bin/php7 /usr/bin/php fi if [ ! -f /usr/lib/libxml2.so ]; then ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so diff --git a/pluie/alpine-apache/README.md b/pluie/alpine-apache/README.md index 2f58cb7..5db30d4 100644 --- a/pluie/alpine-apache/README.md +++ b/pluie/alpine-apache/README.md @@ -4,8 +4,9 @@ - [pluie/alpine][2] ( < 10 MB ) Alpine/3.4 - [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.0 + - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] @@ -91,4 +92,5 @@ $ docker exec -it apache "httpd -h" [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-mysql/README.md b/pluie/alpine-mysql/README.md index bf1d5bf..79dabd9 100644 --- a/pluie/alpine-mysql/README.md +++ b/pluie/alpine-mysql/README.md @@ -6,7 +6,8 @@ - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] Extend pluie/alpine with mysql (MariaDb/10.1.14) @@ -134,4 +135,5 @@ docker run --name mycontainer --link mysql:db ... [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-apache-php7/.gitignore b/pluie/alpine-symfony-php7/.gitignore similarity index 100% rename from pluie/alpine-apache-php7/.gitignore rename to pluie/alpine-symfony-php7/.gitignore diff --git a/pluie/alpine-symfony-php7/Dockerfile b/pluie/alpine-symfony-php7/Dockerfile new file mode 100644 index 0000000..57edea8 --- /dev/null +++ b/pluie/alpine-symfony-php7/Dockerfile @@ -0,0 +1,19 @@ +# @app pluie/alpine-apache +# @author a-Sansara https://git.pluie.org/pluie/docker-images + +FROM pluie/alpine-apache-php7 + +MAINTAINER a-Sansara https://github.com/a-sansara + +ADD files.tar /scripts + +ENV SHENV_NAME=Symfony \ + SHENV_COLOR=33 \ + HTTP_SERVER_NAME=symfony.docker \ + WWW_DIR=web \ + WWW_INDEX=app.php \ + SYMFONY_VERSION=3.2 + +EXPOSE 80 + +RUN bash /scripts/install.sh diff --git a/pluie/alpine-symfony-php7/README.md b/pluie/alpine-symfony-php7/README.md new file mode 100644 index 0000000..6f1a578 --- /dev/null +++ b/pluie/alpine-symfony-php7/README.md @@ -0,0 +1,77 @@ +# pluie/alpine-apache + +- [index][1] +- [pluie/alpine][2] ( < 10 MB ) Alpine/3.4 + - [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 + - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm + - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 + - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) +- [docker tips][5] + +Extend pluie/alpine-apache-php7. + +if __/app/$WWW_DIR__ does not exits then __pluie/alpine-symfony-php7__ install +the symfony framework with $SYMFONY_VERSION version on the /app directory + +## Image Size + +- image ~ 82 MB + +## ENV variables + +``` + SYMFONY_VERSION=3.2 # symfony version +``` + +### Inherit ENV variables + +``` + HTTP_SERVER_NAME=symfony.docker # apache ServerName + WWW_DIR=web # DocumentRoot relative to volume + WWW_INDEX=app.php # DirectoryIndex + SHENV_CTX=LOCAL # LOCAL|INT|PROD change context bg color + SHENV_NAME=symfony # container name + SHENV_COLOR=33 # ANSI EXTENDED COLOR CODE + FIX_OWNERSHIP=1 + TZ=Europe/Paris # TIMEZONE +``` + +## Image Volumes + +- __/app__ directory is a docker volume bind to your symfony project + +__/app/$WWW_DIR__ is the documentRoot. + +__/app/vhost__ is your app vhost configuration file (with a serverName directive). +by default it use the apache rewrite module to redirect all uri to entry point $WWW_INDEX + + +## Image Usage + +chdir to your project directory +``` +$ docker run --name symfony -it --link=mysql:db -v $(pwd):/app pluie/alpine-symfony-php7 +``` +or +``` +$ docker run --name symfony -d --link=mysql:db -e HTTP_SERVER_NAME=yourServerName -v $(pwd):/app pluie/alpine-symfony-php7 +``` + +## Connect to container + +``` +$ docker exec -it symfony bash +``` + + + [1]: https://github.com/pluie-org/docker-images + [2]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine + [3]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache + [4]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-mysql + [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm + [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md + [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-symfony-php7/build b/pluie/alpine-symfony-php7/build new file mode 100755 index 0000000..09b3da8 --- /dev/null +++ b/pluie/alpine-symfony-php7/build @@ -0,0 +1,22 @@ +#!/bin/bash +# @app pluie/alpine-apache +# @author a-Sansara https://git.pluie.org/pluie/docker-images + + Ctitle="\033[1;38;5;15;1;48;5;30m" + Citem="\033[1;38;5;36m" + Coff="\033[m" + DOCKDIR=$(dirname "$(readlink -f ${BASH_SOURCE[0]})") +DOCKBUILD=$(basename $DOCKDIR) + DOCKREPO=$(basename $(dirname $DOCKDIR)) + DOCKTAG=${1:-"latest"} + TMPPWD=$(pwd) + indent=" " +cd $DOCKDIR +echo -e "\n ${Ctitle} Preparing files : ${Coff}${Citem}\n" + +tar -cvf files.tar *.sh pre-init.d/ install.d/ | sed "s/^/${indent}↠ /" + +echo -e "\n ${Ctitle} Proceed Dockerfile build : ${Coff}\n +" +docker build --force-rm -t ${DOCKREPO}/${DOCKBUILD}:${DOCKTAG} . | sed "s/^/${indent}/" +cd $TMPPWD diff --git a/pluie/alpine-symfony-php7/files.tar b/pluie/alpine-symfony-php7/files.tar new file mode 100644 index 0000000..ff9e89c Binary files /dev/null and b/pluie/alpine-symfony-php7/files.tar differ diff --git a/pluie/alpine-symfony-php7/install.d/10-symfony.sh b/pluie/alpine-symfony-php7/install.d/10-symfony.sh new file mode 100755 index 0000000..a8883c1 --- /dev/null +++ b/pluie/alpine-symfony-php7/install.d/10-symfony.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# @app pluie/alpine-symfony +# @author a-Sansara https://git.pluie.org/pluie/docker-images + +apk -U add php7-iconv php7-intl php7-posix +curl -LsS https://symfony.com/installer -o /usr/bin/symfony +chmod +x /usr/bin/symfony diff --git a/pluie/alpine-symfony-php7/main.sh b/pluie/alpine-symfony-php7/main.sh new file mode 100755 index 0000000..b8afa9a --- /dev/null +++ b/pluie/alpine-symfony-php7/main.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# @app pluie/alpine-apache +# @author a-Sansara https://git.pluie.org/pluie/docker-images + +. /scripts/common.sh + +initTitle "Starting" "Apache Daemon" +httpd -D FOREGROUND diff --git a/pluie/alpine-symfony-php7/pre-init.d/10-symfony.sh b/pluie/alpine-symfony-php7/pre-init.d/10-symfony.sh new file mode 100755 index 0000000..c9db74b --- /dev/null +++ b/pluie/alpine-symfony-php7/pre-init.d/10-symfony.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# @app pluie/alpine-symfony +# @author a-Sansara https://git.pluie.org/pluie/docker-images + +if [ ! -d /app/$WWW_DIR ]; then + cd /tmp + mkdir $WWW_DIR + symfony new app $SYMFONY_VERSION + mv app/* /app/ + chown -R 1000:apache /app/ + chown -R 1000:apache /app/var + chmod -R g+w /app +fi diff --git a/pluie/alpine-symfony/Dockerfile b/pluie/alpine-symfony/Dockerfile index bc18bf6..b19b735 100644 --- a/pluie/alpine-symfony/Dockerfile +++ b/pluie/alpine-symfony/Dockerfile @@ -12,7 +12,7 @@ ENV SHENV_NAME=Symfony \ HTTP_SERVER_NAME=symfony.docker \ WWW_DIR=web \ WWW_INDEX=app.php \ - SYMFONY_VERSION=3.1 + SYMFONY_VERSION=3.2 EXPOSE 80 diff --git a/pluie/alpine-symfony/README.md b/pluie/alpine-symfony/README.md index cecffc7..bcdabb8 100644 --- a/pluie/alpine-symfony/README.md +++ b/pluie/alpine-symfony/README.md @@ -6,7 +6,8 @@ - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] Extend pluie/alpine-apache-fpm. @@ -67,4 +68,5 @@ $ docker exec -it symfony bash [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7 diff --git a/pluie/alpine-symfony/pre-init.d/10-symfony.sh b/pluie/alpine-symfony/pre-init.d/10-symfony.sh index 66ef499..a5e2a4c 100644 --- a/pluie/alpine-symfony/pre-init.d/10-symfony.sh +++ b/pluie/alpine-symfony/pre-init.d/10-symfony.sh @@ -2,13 +2,14 @@ # @app pluie/alpine-symfony # @author a-Sansara https://git.pluie.org/pluie/docker-images -ln -s /usr/bin/php7 /usr/bin/php if [ ! -d /app/$WWW_DIR ]; then cd /tmp + ls -la /tmp mkdir $WWW_DIR symfony new app $SYMFONY_VERSION mv app/* /app/ chown -R 1000:apache /app/ - chown -R 1000:nogroup /app/var - chmod -R g+w /app + mkdir -p /app/var/logs + chown -R 1000:apache /app/var + chmod -R g+w /app/ fi diff --git a/pluie/alpine/README.md b/pluie/alpine/README.md index 4b4dc6f..6fc6166 100644 --- a/pluie/alpine/README.md +++ b/pluie/alpine/README.md @@ -4,9 +4,10 @@ - [pluie/alpine][2] ( < 10 MB ) Alpine/3.4 - [pluie/alpine-apache][3] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 - [pluie/alpine-apache-fpm][7] ( ~ 50 MB ) Apache/2.4.23 Php/5.6.24 Fpm - - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.1 + - [pluie/alpine-symfony][6] ( ~ 82 MB ) Symfony2.8 or 3.2 - [pluie/alpine-apache-php7][8] ( ~ 50 MB ) Apache/2.4.25 Php/7.0.15 - - [pluie/alpine-mysql][4] ( ~172 MB ) MariaDb/10.1.14 + - [pluie/alpine-symfony-php7][9] ( ~ 82 MB ) Symfony2.8 or 3.2 Php/7.0.15 + - [pluie/alpine-mysql][4] ( ~172 MB ) Mysql/5.5.47 ( MariaDB ) - [docker tips][5] This Image provide a Linux Alpine distribution with : @@ -106,4 +107,5 @@ RUN bash /scripts/install.sh [7]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-fpm [5]: https://github.com/pluie-org/docker-images/blob/master/DOCKER.md [6]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony - [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/7alpine-php + [8]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-apache-php7 + [9]: https://github.com/pluie-org/docker-images/tree/master/pluie/alpine-symfony-php7