diff --git a/AUTHOR.md b/AUTHOR.md index 016a1c2..6c06124 100644 --- a/AUTHOR.md +++ b/AUTHOR.md @@ -27,6 +27,6 @@ https://exadra37.com --- -[<< previous](./docs/how-to/uninstall.md) | [next >>](CONTRIBUTORS.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/uninstall.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/CONTRIBUTORS.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa32fd4..d04810d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ discussion for the ones you can help. ### In a new Issue If you have a new issue to report, please [create it](https://gitlab.com/exadra37-docker/php/docker-stack/issues/new) by -following the applicable [issue guidelines](docs/how-to/create_an_issue.md). +following the applicable [issue guidelines](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_an_issue.md). ### Solving an Issue @@ -25,11 +25,11 @@ After an agreement is achieved the issue will be assigned to you. Now is time to fork the repository and start coding on it. -When you are ready to merge it, please proceed as per this [Merge Requests Guidelines](docs/how-to/create_a_merge_request.md). +When you are ready to merge it, please proceed as per this [Merge Requests Guidelines](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_a_merge_request.md). --- -[<< previous](./docs/how-to/use.md) | [next >>](./docs/how-to/create_an_issue.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/use.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_an_issue.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 647cb78..01c90a7 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -3,6 +3,6 @@ Before you put your first Merge Request, please add your name to the end of the list: -[<< previous](AUTHOR.md) | [next >>](LICENSE) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/AUTHOR.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/LICENSE) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/README.md b/README.md index 8a8f6c6..e54be18 100644 --- a/README.md +++ b/README.md @@ -10,26 +10,28 @@ From now on, no need to keep messing around the Operating System to have a full ## MENU * **The Package** - + [Why Exists?](./docs/the-package/why_exists.md) - + [What Is It?](./docs/the-package/what_is_it.md) - + [When To use It?](./docs/the-package/when_to_use_it.md) + + [Why Exists?](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/the-package/why_exists.md) + + [What Is It?](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/the-package/what_is_it.md) + + [When To use It?](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/the-package/when_to_use_it.md) * **How To** - + [Install](./docs/how-to/install.md) - + [Use](./docs/how-to/use.md) - + [Report an Issue](./docs/how-to/create_an_issue.md) - + [Create a Branch](./docs/how-to/create_branches.md) - + [Open a Merge Request](./docs/how-to/create_a_merge_request.md) - + [Uninstall](./docs/how-to/uninstall.md) + + [Install](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/install.md) + + [Use](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/use.md) + + [Report an Issue](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_an_issue.md) + + [Create a Branch](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_branches.md) + + [Open a Merge Request](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_a_merge_request.md) + + [Uninstall](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/uninstall.md) * **Demos** - + [Laravel 5.5](./docs/demos/laravel-5.5.md) + + [Laravel 5.5](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/demos/laravel-5.5.md) +* **Troubleshooting** + + [Kibana Login](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/troubleshooting/kibana/login.md) * **Road Map** + [Milestones](https://gitlab.com/exadra37-docker/php/docker-stack/milestones) + [Overview](https://gitlab.com/exadra37-docker/php/docker-stack/boards) * **About** - + [Author](AUTHOR.md) - + [Contributors](CONTRIBUTORS.md) - + [Contributing](CONTRIBUTING.md) - + [License](LICENSE) + + [Author](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/AUTHOR.md) + + [Contributors](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/CONTRIBUTORS.md) + + [Contributing](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/CONTRIBUTING.md) + + [License](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/LICENSE) ## SUPPORT DEVELOPMENT @@ -47,18 +49,14 @@ This repository uses [Explicit Versioning](https://gitlab.com/exadra37-versionin ## BRANCHES -Branches are created as demonstrated [here](docs/how-to/create_branches.md). +Branches are created as demonstrated [here](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_branches.md). This are the type of branches we can see at any moment in the repository: -* `master` - issues and milestones branches will be merged here. Don't use it in - production. -* `last-stable-release` - matches the last stable tag created. Useful for - automation tools. Doesn't guarantee backwards - compatibility. +* `master` - issues and milestones branches will be merged here. Don't use it in production. +* `last-stable-release` - matches the last stable tag created. Useful for automation tools. Doesn't guarantee backwards compatibility. * `4-fix-some-bug` - each issue will have is own branch for development. -* `milestone-12_add-some-new-feature` - all Milestone issues will start, tracked and merged - here. +* `milestone-12_add-some-new-feature` - all Milestone issues will start, tracked and merged here. Only `master` and `last-stable-release` branches will be permanent ones in the repository and all other ones will be removed once they are merged. diff --git a/bin/docker-pull-from-env-vars.sh b/bin/docker-pull-from-env-vars.sh index e8408d7..7be9f51 100755 --- a/bin/docker-pull-from-env-vars.sh +++ b/bin/docker-pull-from-env-vars.sh @@ -6,7 +6,7 @@ set -e # Sourcing ######################################################################################################################## - script_dir=$(dirname $(readlink -f $0)) + script_dir="${PWD}/vendor/exadra37-docker/php-docker-stack/bin" source "${script_dir}/sudo-exists.sh" source "${script_dir}/parse-env-var.sh" diff --git a/bin/parse-env-var.sh b/bin/parse-env-var.sh index f31854a..99a03f6 100755 --- a/bin/parse-env-var.sh +++ b/bin/parse-env-var.sh @@ -29,7 +29,7 @@ function Parse_Env_Var_From_Docker_Compose() local _env_var_default_value="${_env_var_line##*:-}" # removes } from end of string - local _env_var_default_value="${_env_var_default_value::-1}" + local _env_var_default_value="${_env_var_default_value%\}*}" echo "${_env_var_default_value}" } diff --git a/bin/php-docker-stack-setup.sh b/bin/php-docker-stack-setup.sh index ae3b99c..e545a7c 100755 --- a/bin/php-docker-stack-setup.sh +++ b/bin/php-docker-stack-setup.sh @@ -9,7 +9,7 @@ set -e function Create_Dir_If_Not_Exists() { # ~/some/dir becomes /home/username/some/dir - local _dir_path="${1/~\//$HOME\/}" + local _dir_path="${1/~\//$HOME/}" if [ -n "${_dir_path}" ] && [ ! -d "${_dir_path}" ] then @@ -59,6 +59,7 @@ set -e function Set_Env_Vars() { local _env_file="${1?}" + local _project_identifier="${2?}" printf "\n---> SETUP ENVIRONMENT VARIABLES IN ENV FILE\n" @@ -77,6 +78,7 @@ set -e printf "\nSESSION_DRIVER=redis" >> "${_env_file}" printf "\nQUEUE_DRIVER=beanstalkd" >> "${_env_file}" printf "\nREDIS_HOST=cache" >> "${_env_file}" + printf "\nDATABASE_VOLUME_MAP=~/.php-docker-stack/${_project_identifier}/services/database/volumes/mysql:/var/lib/mysql" >> "${_env_file}" # TODO: Only map to port 8000 if no service listening on port 80. printf "\nHTTP_PORT_MAP=8000:80" >> "${_env_file}" @@ -92,8 +94,9 @@ set -e local _host_dir_env_vars="${1?}" local _env_file="${2?}" local _docker_compose_file="${3?}" + local _project_identifier="${4?}" + Set_Env_Vars "${_env_file}" "${_project_identifier}" Create_Default_Host_Dirs_From_Env_Vars "${_host_dir_env_vars}" "${_env_file}" "${_docker_compose_file}" Copy_Docker_Dir_To_Project_Root - Set_Env_Vars "${_env_file}" } diff --git a/bin/server b/bin/server index 755ec69..1cfefae 100755 --- a/bin/server +++ b/bin/server @@ -6,7 +6,7 @@ set -e # Sourcing ######################################################################################################################## - script_dir=$(dirname $(readlink -f $0)) + script_dir="${PWD}/vendor/exadra37-docker/php-docker-stack/bin" source "${script_dir}/sudo-exists.sh" source "${script_dir}/parse-env-var.sh" source "${script_dir}/php-docker-stack-setup.sh" @@ -17,10 +17,17 @@ set -e # Defaults ######################################################################################################################## + env_file=".env" sudo_prefix=$(Sudo_Prefix) env_vars="CACHE_IMAGE,CRON_JOBS_IMAGE,DATABASE_IMAGE,HTTP_IMAGE,LOGS_PIPELINE_IMAGE,LOGS_STORAGE_IMAGE,LOGS_DASHBOARD_IMAGE,PHP_IMAGE,QUEUE_IMAGE,DEV_CLI_IMAGE,DATABASE_CLI_IMAGE" host_dir_env_vars="DATABASE_VOLUME_MAP,LOGS_STORAGE_VOLUME_MAP" + # We will try to grep this file several times, thus it needs to exist to avoid grep errors. + if [ ! -e "${env_file}" ] + then + touch "${env_file}" + fi + ######################################################################################################################## # Functions @@ -90,8 +97,9 @@ set -e ######################################################################################################################## # TODO: Maybe accept them as optional arguments? - env_file=".env" docker_compose_file="vendor/exadra37-docker/php-docker-stack/src/docker-compose.yml" + app_name="$(Get_App_Name "${env_file}")" + project_identifier="${PWD##*/}_${app_name}" if [ -z "${1}" ] then @@ -105,7 +113,7 @@ set -e Show_Help "${script_dir}" ;; --setup-docker-stack) - Setup_Docker_Stack "${host_dir_env_vars}" "${env_file}" "${docker_compose_file}" + Setup_Docker_Stack "${host_dir_env_vars}" "${env_file}" "${docker_compose_file}" "${project_identifier}" exit 0 ;; --update-docker-images) @@ -150,7 +158,7 @@ set -e # to run when the required docker image needs to be build locally. if [ ! -d ./docker ] then - Setup_Docker_Stack "${host_dir_env_vars}" "${env_file}" "${docker_compose_file}" + Setup_Docker_Stack "${host_dir_env_vars}" "${env_file}" "${docker_compose_file}" "${project_identifier}" fi # By default we pull docker images on each server up or server run @@ -175,7 +183,7 @@ set -e # # we want to use the App root as the project directory for docker-compose so that he can read the .env file. "${sudo_prefix}" docker-compose \ - -p "$(Get_App_Name "${env_file}")" \ + -p "${project_identifier}" \ --project-directory "${PWD}" \ --file "${docker_compose_file}" \ "${@}" diff --git a/docs/demos/laravel-5.5.md b/docs/demos/laravel-5.5.md index 46946bc..1b2ec19 100644 --- a/docs/demos/laravel-5.5.md +++ b/docs/demos/laravel-5.5.md @@ -2,57 +2,84 @@ Let's see how easy is to start a Laravel 5.5 project with Php Docker Stack. -Required to run this demo: -* A docker version equal or greater than 1.12.0. -* Docker Composer in a version equal or greater than `2.1`. +## Requirements -> **NOTE:** Please note that this demo is aimed for a 100% docker work-flow, -thus is not necessary to have installed Apache, Nginx, Mysql or any other -dependency than the Docker ones. +### Docker Requirements +To run this demo please ensure that you comply with [this minimal requirements](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/install.md#requirements). -## Create the Laravel Project +> **NOTE:** +> +> → Please note that this demo is aimed for a 100% docker work-flow, thus is not necessary to have installed Php Composer, Apache, Nginx, Mysql or any other dependency than the Docker ones. -Let's install first Laravel 5.5 by using a docker composer image for php7. -In order to avoid type in each composer command `sudo docker run --rm -it -v $PWD/home/composer/app exadra37/php7-composer:php-7.0` +### Php Composer Requirements + +We will use Composer for Php from a Docker Container with the same Php Version we want to run our Php App. + +In order to avoid typing in each php composer command `sudo docker run --rm -it -v $PWD/home/composer/app exadra37/php7-composer:php-7.1` we just need to follow [this instructions](https://gitlab.com/exadra37-docker-images/php7/composer/blob/latest/docs/how-to/install.md#bash-script-alias) to install a simple bash script in `~/home/$USER/bin` that will allow us to invoke it using -only `dkcompoer`. +only `dkcomposer`. + +> **NOTE:** +> +> → If you prefer to not install the bash script alias than, just +replace any occurrence of `dkcomposer` by `sudo docker run --rm -it -v $PWD/home/composer/app exadra37/php7-composer:php-7.1`. + -> **NOTE:** If you prefer to not install the bash script alias than, just -replace any occurrence of `dkcomposer` by `sudo docker run --rm -it -v $PWD/home/composer/app exadra37/php7-composer:php-7.0`. +## Creates the Laravel Project +Time to use `dkcomposer` to create a Laravel 5.5 project... ##### Type in Shell ```bash -dkcomposer --php 7.0 create-project laravel/laravel:5.5.0 && cd laravel +dkcomposer --php 7.1 create-project laravel/laravel:5.5.0 && cd laravel ``` +#### The Env File + +Please open the `.env` file and comment out the following env vars: + ```bash -dkcomposer --php 7.0 require predis/predis:v1.1.1 elasticsearch/elasticsearch:v5.3.0 +#DB_HOST=127.0.0.1 +#REDIS_HOST=127.0.0.1 +#CACHE_DRIVER=file +#SESSION_DRIVER=file +#QUEUE_DRIVER=sync ``` -## Install Php Docker Stack +>**NOTE**: +> +> → This is a temporary solution until it is automated from a bash script. -Requiring Php Docker Stack as a dev dependency... +### Installs Dependencies + +```bash +dkcomposer --php 7.1 require predis/predis:v1.1.1 elasticsearch/elasticsearch:v5.3.0 +``` + +## Installs Php Docker Stack + +Until we reach version `1.0.0.0` we must require only as a `dev` dependency. ##### Type in Shell ```bash -dkcomposer --php 7.0 require --dev exadra37-docker/php-docker-stack +dkcomposer --php 7.1 require --dev exadra37-docker/php-docker-stack:@dev ``` -Before we continue please follow [this instructions](./../how-to-bash-script-alias) in order to -create a bash alias for you shell. +Before we continue please follow [this instructions](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/install.md#bash-script-alias) in order to +create a bash alias for your shell. Now that we have the bash alias `server` for `./vendor/bin/server` let's try running Laravel on a Php Docker Stack... -> **NOTE:** If you prefer to not create the bash alis then just replace all -occurrences of `server` by `./vendor/bin/server`. +> **NOTE:** +> +> → If you don't want to create the bash alias then just replace all occurrences of `server` by `./vendor/bin/server`. ## Running Laravel @@ -112,7 +139,7 @@ Migrating: 2014_10_12_100000_create_password_resets_table Migrated: 2014_10_12_100000_create_password_resets_table ``` -Visit now the browser on http://localhost:8888/register to create an account. +Visit now the browser on http://localhost:8000/register to create an account. ## Logs @@ -168,6 +195,7 @@ $monolog->pushHandler($redisHandler); ``` >**ALERT**: +> > → This code is not intended for use in production, just for this demo. @@ -188,7 +216,8 @@ A login page for Kibana should be visible now. * password - changeme >**ATTENTION**: -> → never use this credentials in production, unless you are asking for trouble. +> +> → never use this credentials in production, unless you are asking for trouble. #### Create Kibana Index @@ -204,5 +233,10 @@ should see now the first log created when you have refreshed the Laravel page in step 3. >**NOTE**: -> → This is a Kibana community version, thus free to use, but once it includes -> X-Pack it requires to [subscribe](https://www.elastic.co/subscriptions) a free plan for continuous usage. +> +> → This is a Kibana community version, thus free to use, but once it includes X-Pack it requires to [subscribe](https://www.elastic.co/subscriptions) a free plan for continuous usage. + + +--- + +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/how-to/create_a_merge_request.md b/docs/how-to/create_a_merge_request.md index cbf61d7..eb05525 100644 --- a/docs/how-to/create_a_merge_request.md +++ b/docs/how-to/create_a_merge_request.md @@ -9,6 +9,6 @@ All optional topics not used must maintain their title and have their body repla --- -[<< previous](create_branches.md) | [next >>](./../../AUTHOR.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_branches.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/AUTHOR.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/how-to/create_an_issue.md b/docs/how-to/create_an_issue.md index edfa82f..6d7fe9b 100644 --- a/docs/how-to/create_an_issue.md +++ b/docs/how-to/create_an_issue.md @@ -12,7 +12,7 @@ All optional topics not used must maintain their title and have their body repla When any created issue do not follow this guidelines it will not be considered. -Each issue will have is own Branch that are created as demonstrated [here](create_branches.md). +Each issue will have is own Branch that are created as demonstrated [here](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_branches.md). ## Bug Fix / Security Fix @@ -40,6 +40,6 @@ Create each issue [here](https://gitlab.com/exadra37-docker/php/docker-stack/iss --- -[<< previous](./../../CONTRIBUTING.md) | [next >>](create_branches.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/CONTRIBUTING.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_branches.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/how-to/create_branches.md b/docs/how-to/create_branches.md index 18f56e5..866012c 100644 --- a/docs/how-to/create_branches.md +++ b/docs/how-to/create_branches.md @@ -5,18 +5,18 @@ Depending on the type of issue the branch for it will have a different origin. ## BUG FIX / SECURITY FIX -As per [Issues Guidelines](docs/how-to/create_an_issue.md) we do not need to have a Milestone for it. +As per [Issues Guidelines](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_an_issue.md) we do not need to have a Milestone for it. Considering that we have issue number `4` with title `Fix Email Validation`. ```bash -git fetch && git checkout -b issue-4_fix-email-validation origin/master +git fetch && git checkout -b 4-fix-email-validation origin/master ``` ## NEW FEATURE / IMPROVE FEATURE / REFRACTING CODE -As per [Issues Guidelines](docs/how-to/create_an_issue.md) we must have a Milestone for this type of requirement. +As per [Issues Guidelines](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_an_issue.md) we must have a Milestone for this type of requirement. Once the Milestone can be split in several issues, lets imagine: @@ -35,20 +35,20 @@ git fetch && git checkout -b milestone-12_add-cache origin/master && git push or #### Creating Issues Branches: ```bash -git fetch && git checkout -b issue-14_create-cache-interfaces origin/milestone-12_add-cache +git fetch && git checkout -b 14_create-cache-interfaces origin/milestone-12_add-cache ``` ```bash -git fetch && git checkout -b issue-15_implement-redis-cache` origin/milestone-12_add-cache +git fetch && git checkout -b 15_implement-redis-cache` origin/milestone-12_add-cache ``` ```bash -git fetch && git checkout -b issue-16_implement-file-system-cache` origin/milestone-12_add-cache +git fetch && git checkout -b 16_implement-file-system-cache` origin/milestone-12_add-cache ``` --- -[<< previous](create_an_issue.md) | [next >>](create_a_merge_request.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_an_issue.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/create_a_merge_request.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/how-to/extract-php-configuration-from-docker-container.md b/docs/how-to/extract-php-configuration-from-docker-container.md new file mode 100644 index 0000000..f4c0f20 --- /dev/null +++ b/docs/how-to/extract-php-configuration-from-docker-container.md @@ -0,0 +1,31 @@ +# HOW TO EXTRACT PHP CONFIGURATION FROM DOCKER CONTAINER + +The following instructions assume that on the the host computer we are in the folder we want to copy the Php configuration to. + +On this docs we use the image `exadra37/php7-fpm:7.1` but to use the official image we just replace the previous by `php:7.1-fpm`. + + +##### on the host shell + +```bash +sudo docker run --rm -it -v $PWD:/var/www/html exadra37/php7-fpm:7.1 bash +``` + +##### on the container shell + +```bash +cp -R /usr/local/etc config && \ +cd config && \ +tar --extract \ + --file=/usr/src/php.tar.xz \ + php-$(php -r "echo PHP_VERSION;")/php.ini-production \ + --strip-components=1 \ + --transform 's/php.ini-production/php.ini/' && \ +exit 0 +``` + +##### on the host shell + +```bash +sudo chown -R $USER:$USER config && ls -al config +``` diff --git a/docs/how-to/install.md b/docs/how-to/install.md index ba9a307..70daba2 100644 --- a/docs/how-to/install.md +++ b/docs/how-to/install.md @@ -9,25 +9,58 @@ Php Docker Stack is easy to install in any Php App using composer to manage thei [follow this instructions](https://docs.docker.com/engine/installation/). * Docker Composer in a version equal or greater than `2.1`. To install Docker Compose please [follow this instructions](https://docs.docker.com/compose/install/). +* By default Elasticsearch is being used as part of the log stack, thus we need to set the `vm.max_map_count` in our host: + + + For current session: + + ```bash + sudo sysctl -w vm.max_map_count=262144 + ``` + + To persist after reboot + + ```bash + sudo sh -c "echo vm.max_map_count=262144 > /etc/sysctl.d/99-max_map_count.conf" + ``` + +> NOTE: +> +> → Above shell commands need to run with root priveleges. +> → Depending on your sytem you may need or not to use `sudo` to obtain root privileges. ## Using Composer Until we reach version `1.0.0.0` we must require only as a `dev` dependency. -##### Type in the shell: +### From Docker Container + +In order to avoid typing in each composer command `sudo docker run --rm -it -v $PWD/home/composer/app exadra37/php7-composer:php-7.1` +we just need to follow [this instructions](https://gitlab.com/exadra37-docker-images/php7/composer/blob/latest/docs/how-to/install.md#bash-script-alias) to install +a simple bash script in `~/home/$USER/bin` that will allow us to invoke it using +only `dkcomposer`. + +> **NOTE:** +> +> → If you prefer to not install the bash script alias than, just replace any occurrence of `dkcomposer` by `sudo docker run --rm -it -v $PWD/home/composer/app exadra37/php7-composer:php-7.1`. + +##### Type in Shell ```bash -composer require --dev exadra37-docker/php-docker-stack +dkcomposer --php 7.1 require --dev exadra37-docker/php-docker-stack:@dev ``` +### Advantages of using composer from Docker Container instead from Localhost: + +* guarantees we run composer in the same Php version used by our Php App. +* packages that are sensitive to the Php version are installed in the correct version. + ## Using Git ##### Type in the shell: ```bash -mkdir -p vendor/exadra37-docker && git clone https://gitlab.com/exadra37-docker/php/docker-stack.git vendor/exadra37-docker/php-docker-stack && ln -s ./../exadra37-docker/php-docker-stack/bin/server ./vendor/bin/server +mkdir -p vendor/{exadra37-docker,bin} && git clone https://gitlab.com/exadra37-docker/php/docker-stack.git vendor/exadra37-docker/php-docker-stack && ln -s ./../exadra37-docker/php-docker-stack/bin/server ./vendor/bin/server ``` @@ -95,6 +128,6 @@ We should now see the same output from when we run `./vendor/bin/server --help`. --- -[<< previous](./../the-package/why_exists.md) | [next >>](use.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/the-package/why_exists.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/use.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/how-to/uninstall.md b/docs/how-to/uninstall.md index 7c796e2..79830ea 100644 --- a/docs/how-to/uninstall.md +++ b/docs/how-to/uninstall.md @@ -23,6 +23,6 @@ Please [give us feedback](https://gitlab.com/exadra37-docker/php/docker-stack/is --- -[<< previous](create_a_merge_request.md) | [next >>](./../../AUTHOR.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs//how-to/create_a_merge_request.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/AUTHOR.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/how-to/use.md b/docs/how-to/use.md index 2fed570..42aabdd 100644 --- a/docs/how-to/use.md +++ b/docs/how-to/use.md @@ -2,8 +2,8 @@ Any developer with zero experience of Docker can take advantage of Php Docker Stack work-flow. -This how to use instructions assumes that the [Install Intructions](install.md) have been followed, including the -[Bash Script Alias](install.md#bash-script-alias) creation. +This how to use instructions assumes that the [Install Instructions](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/install.md) have been followed, including the +[Bash Script Alias](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs//how-to/install.md#bash-script-alias) creation. Users with knowledge of using the `docker-compose` command can take advantage of all is capabilities, once `server` is only an alias to it. @@ -86,6 +86,6 @@ To go out of the shell in the container just type `exit`. --- -[<< previous](install.md) | [next >>](./../../CONTRIBUTING.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/install.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/CONTRIBUTING.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/the-package/what_is_it.md b/docs/the-package/what_is_it.md index 8252aa6..dd87972 100644 --- a/docs/the-package/what_is_it.md +++ b/docs/the-package/what_is_it.md @@ -37,7 +37,7 @@ This means we can choose the image that best suites our needs to attach to each --- -[<< previous](why_exists.md) | [next >>](when_to_use_it.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/the-package/why_exists.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/the-package/when_to_use_it.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/the-package/when_to_use_it.md b/docs/the-package/when_to_use_it.md index 8ebe44b..cae6b67 100644 --- a/docs/the-package/when_to_use_it.md +++ b/docs/the-package/when_to_use_it.md @@ -10,6 +10,6 @@ way to go. --- -[<< previous](what_is_it.md) | [next >>](./../how-to/install.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/the-package/what_is_it.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to/install.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/the-package/why_exists.md b/docs/the-package/why_exists.md index 0fa905f..d7b258b 100644 --- a/docs/the-package/why_exists.md +++ b/docs/the-package/why_exists.md @@ -19,7 +19,7 @@ Using Docker is precisely to avoid the above type of commentaries. --- -[<< previous](./../../README.md) | [next >>](what_is_it.md) +[<< previous](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) | [next >>](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/the-package/what_is_it.md) -[HOME](./../../README.md) +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/docs/troubleshooting/kibana/login.md b/docs/troubleshooting/kibana/login.md new file mode 100644 index 0000000..126c8bc --- /dev/null +++ b/docs/troubleshooting/kibana/login.md @@ -0,0 +1,39 @@ +# TROUBLESHOOTING KIBANA + + +## Login + +### Login Disabled - Unable to determine license + +#### The Error + +When trying to access Kibana for the first time we are redirected to the login +page, but login fields are disabled and big red alert is displayed below with an +error message. + +##### Error message: + +``` +Login is currently disabled because the license could not be determined. +Please check that Elasticsearch has the X-Pack plugin installed and is reachable, then refresh this page. +``` + +#### The Cause + +As per [this Stackoverflow reply](https://stackoverflow.com/a/28025994) this can +happen because we reached the disk space threshold from where Elasticsearch will +not allocate more shards to the node. + + +#### The Solution + +##### Settings: + +``` +cluster.routing.allocation.disk.watermark.low=2gb +cluster.routing.allocation.disk.watermark.high=1gb +``` + +This must be added in docker compose environment section or in elasticsearch yml configuration file. + +More details on this settings can be found in [this ElasticSearch docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html). diff --git a/src/docker-compose.yml b/src/docker-compose.yml index d95cb99..d16c849 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -24,8 +24,8 @@ services: - app_network cron-jobs: - build: ${CRON_JOBS_IMAGE_BUILD_DIR:-./docker/cron-jobs/php7-fpm/build} - image: ${CRON_JOBS_IMAGE:-exadra37/php7-fpm:latest} + build: ${CRON_JOBS_IMAGE_BUILD_DIR:-./docker/cron-jobs/php7-fpm/build}/${PHP_VERSION:-7.2} + image: ${CRON_JOBS_IMAGE:-exadra37/php7-cron-jobs}:${PHP_VERSION:-7.2} working_dir: ${CONTAINER_CODE_DIR:-/var/www} depends_on: database: @@ -36,6 +36,15 @@ services: condition: service_healthy queue: condition: service_healthy + volumes: + # override from .env file like: PHP_CONFIG_VOLUME_MAP=./docker/cron-jobs/php7-fpm/build/7.2/config/default:/usr/local/etc + - ${CRON_JOBS_CONFIG_VOLUME_MAP:-./docker/.suppress-default-map:/.suppress-default-map} + + # ./docker/cron-jobs/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini:/usr/local/etc/php/conf.d/zzz-custom.ini + - ${CRON_JOBS_IMAGE_BUILD_DIR:-./docker/cron-jobs/php7-fpm/build}/${PHP_VERSION:-7.2}/${PHP_CUSTOM_PHP_INI_MAP:-config/custom/php/conf.d/zzz-custom.ini:/usr/local/etc/php/conf.d/zzz-custom.ini} + + # ./docker/cron-jobs/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf:/usr/local/etc/php-fpm.d/zzz-custom.conf + - ${CRON_JOBS_IMAGE_BUILD_DIR:-./docker/cron-jobs/php7-fpm/build}/${PHP_VERSION:-7.2}/${PHP_CUSTOM_PHP_FPM_CONF_MAP:-config/custom/php-fpm.d/zzz-custom.conf:/usr/local/etc/php-fpm.d/zzz-custom.conf} volumes_from: - code networks: @@ -128,8 +137,8 @@ services: - app_network php: - build: ${PHP_IMAGE_BUILD_DIR:-./docker/php/php7-fpm/build} - image: ${PHP_IMAGE:-exadra37/php7-fpm:latest} + build: ${PHP_IMAGE_BUILD_DIR:-./docker/php/php7-fpm/build}/${PHP_VERSION:-7.2} + image: ${PHP_IMAGE:-exadra37/php7-fpm}:${PHP_VERSION:-7.2} working_dir: ${CONTAINER_CODE_DIR:-/var/www} healthcheck: test: "exit 0" @@ -143,7 +152,14 @@ services: queue: condition: service_healthy volumes: - - ${PHP_INI_VOLUME_MAP:-./docker/php/php7-fpm/php.ini:/usr/local/etc/php.ini} + # override from .env file like: PHP_CONFIG_VOLUME_MAP=./docker/php/php7-fpm/build/7.2/config/default:/usr/local/etc + - ${PHP_CONFIG_VOLUME_MAP:-./docker/.suppress-default-map:/.suppress-default-map} + + # ./docker/php/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini:/usr/local/etc/php/conf.d/zzz-custom.ini + - ${PHP_IMAGE_BUILD_DIR:-./docker/php/php7-fpm/build}/${PHP_VERSION:-7.2}/${PHP_CUSTOM_PHP_INI_MAP:-config/custom/php/conf.d/zzz-custom.ini:/usr/local/etc/php/conf.d/zzz-custom.ini} + + # ./docker/php/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf:/usr/local/etc/php-fpm.d/zzz-custom.conf + - ${PHP_IMAGE_BUILD_DIR:-./docker/php/php7-fpm/build}/${PHP_VERSION:-7.2}/${PHP_CUSTOM_PHP_FPM_CONF_MAP:-config/custom/php-fpm.d/zzz-custom.conf:/usr/local/etc/php-fpm.d/zzz-custom.conf} volumes_from: - code networks: @@ -165,8 +181,8 @@ services: ################### dev-cli: - build: ${DEV_CLI_IMAGE_BUILD_DIR:-./docker/dev-cli/php7/build} - image: ${DEV_CLI_IMAGE:-exadra37/php7-dev-cli:latest} + build: ${DEV_CLI_IMAGE_BUILD_DIR:-./docker/dev-cli/php7-fpm/build}/${PHP_VERSION:-7.2} + image: ${DEV_CLI_IMAGE:-exadra37/php7-dev-cli}:${PHP_VERSION:-7.2} working_dir: ${CONTAINER_CODE_DIR:-/var/www} depends_on: database: @@ -180,8 +196,17 @@ services: queue: condition: service_healthy volumes: + # /home/$USER/.ssh:/home/php-fpm/.ssh - ${DEV_CLI_SSH_VOLUME_MAP:-~/.ssh:/home/php-fpm/.ssh} + + # /home/$USER/.gitconfig:/home/php-fpm/.gitconfig - ${DEV_CLI_GIT_CONFIG_VOLUME_MAP:-~/.gitconfig:/home/php-fpm/.gitconfig} + + # ./docker/dev-cli/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini:/usr/local/etc/php/conf.d/zzz-custom.ini + - ${DEV_CLI_IMAGE_BUILD_DIR:-./docker/dev-cli/php7-fpm/build}/${PHP_VERSION:-7.2}/${DEV_CLI_CUSTOM_PHP_INI_MAP:-config/custom/php/conf.d/zzz-custom.ini:/usr/local/etc/php/conf.d/zzz-custom.ini} + + # ./docker/dev-cli/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf:/usr/local/etc/php-fpm.d/zzz-custom.conf + - ${DEV_CLI_IMAGE_BUILD_DIR:-./docker/dev-cli/php7-fpm/build}/${PHP_VERSION:-7.2}/${DEV_CLI_CUSTOM_PHP_FPM_CONF_MAP:-config/custom/php-fpm.d/zzz-custom.conf:/usr/local/etc/php-fpm.d/zzz-custom.conf} volumes_from: - code networks: diff --git a/src/docker/.suppress-default-map b/src/docker/.suppress-default-map new file mode 100644 index 0000000..5560c39 --- /dev/null +++ b/src/docker/.suppress-default-map @@ -0,0 +1,7 @@ +Dummy file to be used when we want to suppress some map in the docker compose file. + +So to suppress the map we only need to add the map into our .env file. + +Example: + +PHP_CONFIG_VOLUME_MAP=./docker/.suppress-default-map:/.suppress-default-map diff --git a/src/docker/cron-jobs/php7-fpm/build/7.0/Dockerfile b/src/docker/cron-jobs/php7-fpm/build/7.0/Dockerfile new file mode 100644 index 0000000..410ea82 --- /dev/null +++ b/src/docker/cron-jobs/php7-fpm/build/7.0/Dockerfile @@ -0,0 +1,3 @@ +FROM exadra37/php7-fpm:7.0 + +# Our custom image diff --git a/src/docker/cron-jobs/php7-fpm/build/7.0/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/cron-jobs/php7-fpm/build/7.0/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/cron-jobs/php7-fpm/build/7.0/config/custom/php/conf.d/zzz-custom.ini b/src/docker/cron-jobs/php7-fpm/build/7.0/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/cron-jobs/php7-fpm/build/7.1/Dockerfile b/src/docker/cron-jobs/php7-fpm/build/7.1/Dockerfile new file mode 100644 index 0000000..0391868 --- /dev/null +++ b/src/docker/cron-jobs/php7-fpm/build/7.1/Dockerfile @@ -0,0 +1,3 @@ +FROM exadra37/php7-fpm:7.1 + +# Our custom image diff --git a/src/docker/cron-jobs/php7-fpm/build/7.1/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/cron-jobs/php7-fpm/build/7.1/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/cron-jobs/php7-fpm/build/7.1/config/custom/php/conf.d/zzz-custom.ini b/src/docker/cron-jobs/php7-fpm/build/7.1/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/cron-jobs/php7-fpm/build/7.2/Dockerfile b/src/docker/cron-jobs/php7-fpm/build/7.2/Dockerfile new file mode 100644 index 0000000..a08c916 --- /dev/null +++ b/src/docker/cron-jobs/php7-fpm/build/7.2/Dockerfile @@ -0,0 +1,3 @@ +FROM exadra37/php7-fpm:7.2 + +# Our custom image diff --git a/src/docker/cron-jobs/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/cron-jobs/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/cron-jobs/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini b/src/docker/cron-jobs/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/cron-jobs/php7-fpm/build/Dockerfile b/src/docker/cron-jobs/php7-fpm/build/Dockerfile deleted file mode 100644 index d977112..0000000 --- a/src/docker/cron-jobs/php7-fpm/build/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM exadra37/php7-fpm:latest - -# Our custom image diff --git a/src/docker/cron-jobs/php7-fpm/build/README.md b/src/docker/cron-jobs/php7-fpm/build/README.md new file mode 100644 index 0000000..9ed162d --- /dev/null +++ b/src/docker/cron-jobs/php7-fpm/build/README.md @@ -0,0 +1,19 @@ +# PHP 7 DEVELOPMENT CLI + +From docker compose we load by default 2 custom configuration files: + +* `./php/conf.d/zzz-custom.ini` - add additional ini settings for development, like enabling php to display errors. +* `./php-fpm.d/zzz-custom.conf` - add additional configuration settings for php-fpm. + +>**NOTE:** +> +> * In order to maintain parity between production and development environments be very careful with what settings you add/override. +> + increasing memory limit is an a bad example of add/override a setting once is breaking the parity between environments. +> + enabling php to display errors is a good example of add/override a setting. +> * Any custom setting added here will only take effect when running command line scripts or running tests inside the `dev-cli` container. +> * To add/override settings on `php` container you must do so on `./docker/php/php7-fpm//build/{PHP_VERSION}/config`. + + +--- + +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/src/docker/dev-cli/php7-fpm/build/7.0/Dockerfile b/src/docker/dev-cli/php7-fpm/build/7.0/Dockerfile new file mode 100644 index 0000000..b3b2dfb --- /dev/null +++ b/src/docker/dev-cli/php7-fpm/build/7.0/Dockerfile @@ -0,0 +1,3 @@ +FROM exadra37/php7-dev-cli:7.0 + +# Our custom image diff --git a/src/docker/dev-cli/php7-fpm/build/7.0/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/dev-cli/php7-fpm/build/7.0/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/dev-cli/php7-fpm/build/7.0/config/custom/php/conf.d/zzz-custom.ini b/src/docker/dev-cli/php7-fpm/build/7.0/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/dev-cli/php7-fpm/build/7.1/Dockerfile b/src/docker/dev-cli/php7-fpm/build/7.1/Dockerfile new file mode 100644 index 0000000..0ab8f28 --- /dev/null +++ b/src/docker/dev-cli/php7-fpm/build/7.1/Dockerfile @@ -0,0 +1,3 @@ +FROM exadra37/php7-dev-cli:7.1 + +# Our custom image diff --git a/src/docker/dev-cli/php7-fpm/build/7.1/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/dev-cli/php7-fpm/build/7.1/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/dev-cli/php7-fpm/build/7.1/config/custom/php/conf.d/zzz-custom.ini b/src/docker/dev-cli/php7-fpm/build/7.1/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/dev-cli/php7-fpm/build/7.2/Dockerfile b/src/docker/dev-cli/php7-fpm/build/7.2/Dockerfile new file mode 100644 index 0000000..db71657 --- /dev/null +++ b/src/docker/dev-cli/php7-fpm/build/7.2/Dockerfile @@ -0,0 +1,2 @@ +FROM exadra37/php7-dev-cli:7.2 +# Our custom image diff --git a/src/docker/dev-cli/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/dev-cli/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/dev-cli/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini b/src/docker/dev-cli/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/dev-cli/php7-fpm/build/README.md b/src/docker/dev-cli/php7-fpm/build/README.md new file mode 100644 index 0000000..9ed162d --- /dev/null +++ b/src/docker/dev-cli/php7-fpm/build/README.md @@ -0,0 +1,19 @@ +# PHP 7 DEVELOPMENT CLI + +From docker compose we load by default 2 custom configuration files: + +* `./php/conf.d/zzz-custom.ini` - add additional ini settings for development, like enabling php to display errors. +* `./php-fpm.d/zzz-custom.conf` - add additional configuration settings for php-fpm. + +>**NOTE:** +> +> * In order to maintain parity between production and development environments be very careful with what settings you add/override. +> + increasing memory limit is an a bad example of add/override a setting once is breaking the parity between environments. +> + enabling php to display errors is a good example of add/override a setting. +> * Any custom setting added here will only take effect when running command line scripts or running tests inside the `dev-cli` container. +> * To add/override settings on `php` container you must do so on `./docker/php/php7-fpm//build/{PHP_VERSION}/config`. + + +--- + +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md) diff --git a/src/docker/dev-cli/php7/build/Dockerfile b/src/docker/dev-cli/php7/build/Dockerfile deleted file mode 100644 index 8943c1d..0000000 --- a/src/docker/dev-cli/php7/build/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM exadra37/php7-dev-cli:latest - -# Our custom image diff --git a/src/docker/php/php7-fpm/build/7.0/Dockerfile b/src/docker/php/php7-fpm/build/7.0/Dockerfile new file mode 100644 index 0000000..410ea82 --- /dev/null +++ b/src/docker/php/php7-fpm/build/7.0/Dockerfile @@ -0,0 +1,3 @@ +FROM exadra37/php7-fpm:7.0 + +# Our custom image diff --git a/src/docker/php/php7-fpm/build/7.0/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/php/php7-fpm/build/7.0/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/php/php7-fpm/build/7.0/config/custom/php/conf.d/zzz-custom.ini b/src/docker/php/php7-fpm/build/7.0/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/php/php7-fpm/build/7.1/Dockerfile b/src/docker/php/php7-fpm/build/7.1/Dockerfile new file mode 100644 index 0000000..0391868 --- /dev/null +++ b/src/docker/php/php7-fpm/build/7.1/Dockerfile @@ -0,0 +1,3 @@ +FROM exadra37/php7-fpm:7.1 + +# Our custom image diff --git a/src/docker/php/php7-fpm/build/7.1/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/php/php7-fpm/build/7.1/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/php/php7-fpm/build/7.1/config/custom/php/conf.d/zzz-custom.ini b/src/docker/php/php7-fpm/build/7.1/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/php/php7-fpm/build/7.2/Dockerfile b/src/docker/php/php7-fpm/build/7.2/Dockerfile new file mode 100644 index 0000000..a08c916 --- /dev/null +++ b/src/docker/php/php7-fpm/build/7.2/Dockerfile @@ -0,0 +1,3 @@ +FROM exadra37/php7-fpm:7.2 + +# Our custom image diff --git a/src/docker/php/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf b/src/docker/php/php7-fpm/build/7.2/config/custom/php-fpm.d/zzz-custom.conf new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/php/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini b/src/docker/php/php7-fpm/build/7.2/config/custom/php/conf.d/zzz-custom.ini new file mode 100644 index 0000000..e69de29 diff --git a/src/docker/php/php7-fpm/build/Dockerfile b/src/docker/php/php7-fpm/build/Dockerfile deleted file mode 100644 index d977112..0000000 --- a/src/docker/php/php7-fpm/build/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM exadra37/php7-fpm:latest - -# Our custom image diff --git a/src/docker/php/php7-fpm/build/README.md b/src/docker/php/php7-fpm/build/README.md new file mode 100644 index 0000000..4a3dad7 --- /dev/null +++ b/src/docker/php/php7-fpm/build/README.md @@ -0,0 +1,27 @@ +# PHP FPM 7.1 + +The content of `./7.1/config/default` folder was extracted as per [this instructions](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/docs/how-to) from the docker container used by default +for php service in docker compose, that currently is `exadra37/php7-fpm:7.1` that extends the official image `php-fpm:7.1`. + +From the shell, inside the running container, we can confirm that the exact php version on time of the extraction was: + +```bash +root@b8146544dbf9:/var/www/html# php -v +PHP 7.1.11 (cli) (built: Nov 4 2017 10:24:56) ( NTS ) +Copyright (c) 1997-2017 The PHP Group +Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies +``` + +> **NOTE**: +> +> * This config is exactly the same of official image therefor is not mapped by default in the docker compose file. +> * Use it as the base to build your custom configuration and then just override the default map from the .env file. +> * In order to maintain parity between production and development environments you should use same configuration across both. +> * For development you may want to enable some settings, thus you must do it from `config/custom/` folder. +> + enabling xdebug is a good example of using a custom setting. +> + increasing memory limit is a bad example of using a custom setting. + + +--- + +[HOME](https://gitlab.com/exadra37-docker/php/docker-stack/blob/master/README.md)