diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index f3a7780..97e51e4 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -922,6 +922,26 @@ docker-compose up -d minio ``` + +
+ +## Use AWS + +1 - Configure AWS: + - make sure to add your SSH keys in aws/ssh_keys folder + +2 - Run the Aws Container (`aws`) with the `docker-compose up` command. Example: + +```bash +docker-compose up -d aws +``` + +3 - Access the aws container with `docker-compose exec aws bash` + +4 - To start using eb cli inside the container, initiaze your project first by doing 'eb init'. Read the [aws eb cli](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html) docs for more details. + + +
@@ -1660,3 +1680,7 @@ This error sometimes happens because your Laravel application isn't running on t 2. Change the `DB_HOST` variable on env with the IP that you received from previous step. * Option B 1. Change the `DB_HOST` value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as `mysql` + +## I get stuck when building ngxinx on `fetch http://mirrors.aliyun.com/alpine/v3.5/main/x86_64/APKINDEX.tar.gz` + +As stated on [#749](https://github.com/laradock/laradock/issues/749#issuecomment-293296687), removing the line `RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories` from `nginx/Dockerfile` solves the problem. diff --git a/apache2/Dockerfile b/apache2/Dockerfile index bc152dd..9624d97 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -4,11 +4,14 @@ MAINTAINER Eric Pfeiffer ARG PHP_UPSTREAM_CONTAINER=php-fpm ARG PHP_UPSTREAM_PORT=9000 +ARG PHP_UPSTREAM_TIMEOUT=60 ENV WEB_PHP_SOCKET=${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT} ENV WEB_DOCUMENT_ROOT=/var/www/ +ENV WEB_PHP_TIMEOUT=${PHP_UPSTREAM_TIMEOUT} + EXPOSE 80 443 WORKDIR /var/www/ diff --git a/aws/.gitignore b/aws/.gitignore new file mode 100644 index 0000000..4619483 --- /dev/null +++ b/aws/.gitignore @@ -0,0 +1 @@ +./ssh_keys diff --git a/aws/Dockerfile b/aws/Dockerfile new file mode 100644 index 0000000..4f03e9d --- /dev/null +++ b/aws/Dockerfile @@ -0,0 +1,17 @@ +FROM python:slim + +MAINTAINER melchabcede@gmail.com + +RUN pip install --upgrade --no-cache-dir awsebcli +RUN apt-get -yqq update && apt-get -yqq install git-all + +#NOTE: make sure ssh keys are added to ssh_keys folder + +RUN mkdir root/tmp_ssh +COPY /ssh_keys/. /root/.ssh/ +RUN cd /root/.ssh && chmod 600 * && chmod 644 *.pub + +# Set default work directory +WORKDIR /var/www + + diff --git a/docker-compose.yml b/docker-compose.yml index 2173df7..b44e8b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,7 @@ services: - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} - INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP} - INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO} + - INSTALL_PHPREDIS=${WORKSPACE_INSTALL_PHPREDIS} - INSTALL_MSSQL=${WORKSPACE_INSTALL_MSSQL} - INSTALL_NODE=${WORKSPACE_INSTALL_NODE} - INSTALL_YARN=${WORKSPACE_INSTALL_YARN} @@ -36,6 +37,7 @@ services: - INSTALL_SYMFONY=${WORKSPACE_INSTALL_SYMFONY} - INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON} - INSTALL_IMAGE_OPTIMIZERS=${WORKSPACE_INSTALL_IMAGE_OPTIMIZERS} + - INSTALL_IMAGEMAGICK=${WORKSPACE_INSTALL_IMAGEMAGICK} - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} - NODE_VERSION=${WORKSPACE_NODE_VERSION} @@ -80,6 +82,7 @@ services: - INSTALL_LDAP=${PHP_FPM_INSTALL_LDAP} - INSTALL_SWOOLE=${PHP_FPM_INSTALL_SWOOLE} - INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS} + - INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK} dockerfile: "Dockerfile-${PHP_VERSION}" volumes_from: - applications @@ -153,6 +156,7 @@ services: args: - PHP_UPSTREAM_CONTAINER=${APACHE_PHP_UPSTREAM_CONTAINER} - PHP_UPSTREAM_PORT=${APACHE_PHP_UPSTREAM_PORT} + - PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT} volumes_from: - applications volumes: @@ -213,7 +217,6 @@ services: - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d ports: - "${MYSQL_PORT}:3306" - user: "1000:50" networks: - backend @@ -635,6 +638,16 @@ services: - frontend - backend +### AWS EB-CLI #### + aws: + build: + context: ./aws + volumes_from: + - applications + depends_on: + - workspace + tty: true + ### Networks Setup ############################################ networks: diff --git a/env-example b/env-example index 15beb1a..7357b3e 100644 --- a/env-example +++ b/env-example @@ -32,6 +32,7 @@ PHP_INTERPRETER=php-fpm WORKSPACE_INSTALL_XDEBUG=false WORKSPACE_INSTALL_SOAP=false WORKSPACE_INSTALL_MONGO=false +WORKSPACE_INSTALL_PHPREDIS=false WORKSPACE_INSTALL_MSSQL=false WORKSPACE_INSTALL_NODE=false WORKSPACE_INSTALL_YARN=false @@ -49,6 +50,7 @@ WORKSPACE_INSTALL_MC=false WORKSPACE_INSTALL_SYMFONY=false WORKSPACE_INSTALL_PYTHON=false WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=false +WORKSPACE_INSTALL_IMAGEMAGICK=false WORKSPACE_PUID=1000 WORKSPACE_PGID=1000 WORKSPACE_NODE_VERSION=stable @@ -76,6 +78,7 @@ PHP_FPM_INSTALL_GHOSTSCRIPT=false PHP_FPM_INSTALL_LDAP=false PHP_FPM_INSTALL_SWOOLE=false PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=false +PHP_FPM_INSTALL_IMAGEMAGICK=false ### NGINX ############################################################################################################## @@ -94,6 +97,7 @@ APACHE_HOST_LOG_PATH=./logs/apache2 APACHE_SITES_PATH=./apache2/sites APACHE_PHP_UPSTREAM_CONTAINER=php-fpm APACHE_PHP_UPSTREAM_PORT=9000 +APACHE_PHP_UPSTREAM_TIMEOUT=60 ### MYSQL ############################################################################################################## diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 77f4abd..4a491b0 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -7,9 +7,6 @@ ADD nginx.conf /etc/nginx/ ARG PHP_UPSTREAM_CONTAINER=php-fpm ARG PHP_UPSTREAM_PORT=9000 -# fix a problem--#397, change application source from dl-cdn.alpinelinux.org to aliyun source. -RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories - RUN apk update \ && apk upgrade \ && apk add --no-cache bash \ diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 1d8fd97..ed8cb89 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -87,7 +87,7 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ # Install Php Redis Extension - pecl install -o -f redis \ + printf "\n" | pecl install -o -f redis \ && rm -rf /tmp/pear \ && docker-php-ext-enable redis \ ;fi @@ -269,6 +269,19 @@ RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \ ;fi +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get update -y && \ + apt-get install -y libmagickwand-dev imagemagick && \ + pecl install imagick && \ + docker-php-ext-enable imagick \ +;fi + # #-------------------------------------------------------------------------- # Final Touch @@ -276,7 +289,7 @@ RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ # ADD ./laravel.ini /usr/local/etc/php/conf.d -ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ +ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/ #RUN rm -r /var/lib/apt/lists/* diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index b643a38..daf214a 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -84,7 +84,7 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ # Install Php Redis Extension - pecl install -o -f redis \ + printf "\n" | pecl install -o -f redis \ && rm -rf /tmp/pear \ && docker-php-ext-enable redis \ ;fi @@ -293,6 +293,19 @@ RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \ ;fi +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get update -y && \ + apt-get install -y libmagickwand-dev imagemagick && \ + pecl install imagick && \ + docker-php-ext-enable imagick \ +;fi + # #-------------------------------------------------------------------------- # Final Touch @@ -300,7 +313,7 @@ RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ # ADD ./laravel.ini /usr/local/etc/php/conf.d/ -ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ +ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/ #RUN rm -r /var/lib/apt/lists/* diff --git a/php-fpm/Dockerfile-71 b/php-fpm/Dockerfile-71 index 90ea2bd..1210f29 100644 --- a/php-fpm/Dockerfile-71 +++ b/php-fpm/Dockerfile-71 @@ -78,13 +78,13 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ ;fi ##################################### -# PHP REDIS EXTENSION FOR PHP 7 +# PHP REDIS EXTENSION FOR PHP 7.0 ##################################### ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ # Install Php Redis Extension - pecl install -o -f redis \ + printf "\n" | pecl install -o -f redis \ && rm -rf /tmp/pear \ && docker-php-ext-enable redis \ ;fi @@ -300,6 +300,19 @@ RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \ ;fi +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get update -y && \ + apt-get install -y libmagickwand-dev imagemagick && \ + pecl install imagick && \ + docker-php-ext-enable imagick \ +;fi + # #-------------------------------------------------------------------------- # Final Touch @@ -307,7 +320,7 @@ RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ # ADD ./laravel.ini /usr/local/etc/php/conf.d -ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ +ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/ #RUN rm -r /var/lib/apt/lists/* diff --git a/php-fpm/laravel.pool.conf b/php-fpm/xlaravel.pool.conf similarity index 100% rename from php-fpm/laravel.pool.conf rename to php-fpm/xlaravel.pool.conf diff --git a/workspace/Dockerfile-56 b/workspace/Dockerfile-56 index a5ba788..bac3ee9 100644 --- a/workspace/Dockerfile-56 +++ b/workspace/Dockerfile-56 @@ -194,6 +194,19 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ln -s /etc/php/5.6/mods-available/mongodb.ini /etc/php/5.6/cli/conf.d/30-mongodb.ini \ ;fi +##################################### +# PHP REDIS EXTENSION FOR PHP 5.6 +##################################### + +ARG INSTALL_PHPREDIS=false +ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS} +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis extension + printf "\n" | pecl -q install -o -f redis && \ + echo "extension=redis.so" >> /etc/php/5.6/mods-available/redis.ini && \ + phpenmod redis \ +;fi + ##################################### # Drush: ##################################### @@ -263,6 +276,9 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + ##################################### # YARN: ##################################### @@ -483,6 +499,16 @@ RUN if [ ${INSTALL_PYTHON} = true ]; then \ && pip install --upgrade virtualenv \ ;fi +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get install -y --force-yes imagemagick php-imagick \ +;fi + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/Dockerfile-70 b/workspace/Dockerfile-70 index 3d1cde5..2018816 100644 --- a/workspace/Dockerfile-70 +++ b/workspace/Dockerfile-70 @@ -194,6 +194,19 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ln -s /etc/php/7.0/mods-available/mongodb.ini /etc/php/7.0/cli/conf.d/30-mongodb.ini \ ;fi +##################################### +# PHP REDIS EXTENSION FOR PHP 7 +##################################### + +ARG INSTALL_PHPREDIS=false +ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS} +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis extension + printf "\n" | pecl -q install -o -f redis && \ + echo "extension=redis.so" >> /etc/php/7.0/mods-available/redis.ini && \ + phpenmod redis \ +;fi + ##################################### # Drush: ##################################### @@ -263,6 +276,9 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + ##################################### # YARN: ##################################### @@ -564,6 +580,16 @@ RUN if [ ${INSTALL_PYTHON} = true ]; then \ && pip install --upgrade virtualenv \ ;fi +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get install -y --force-yes imagemagick php-imagick \ +;fi + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 index b0320e6..aeaec9c 100644 --- a/workspace/Dockerfile-71 +++ b/workspace/Dockerfile-71 @@ -186,11 +186,24 @@ ARG INSTALL_MONGO=false ENV INSTALL_MONGO ${INSTALL_MONGO} RUN if [ ${INSTALL_MONGO} = true ]; then \ # Install the mongodb extension - pecl install mongodb && \ + pecl -q install mongodb && \ echo "extension=mongodb.so" >> /etc/php/7.1/mods-available/mongodb.ini && \ ln -s /etc/php/7.1/mods-available/mongodb.ini /etc/php/7.1/cli/conf.d/30-mongodb.ini \ ;fi +##################################### +# PHP REDIS EXTENSION FOR PHP 7.1 +##################################### + +ARG INSTALL_PHPREDIS=false +ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS} +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis extension + printf "\n" | pecl -q install -o -f redis && \ + echo "extension=redis.so" >> /etc/php/7.1/mods-available/redis.ini && \ + phpenmod redis \ +;fi + ##################################### # Drush: ##################################### @@ -260,6 +273,10 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + + ##################################### # YARN: ##################################### @@ -569,6 +586,15 @@ RUN if [ ${INSTALL_PYTHON} = true ]; then \ && pip install --upgrade virtualenv \ ;fi +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get install -y --force-yes imagemagick php-imagick \ +;fi # #--------------------------------------------------------------------------