├── .env ├── .gitignore ├── README.md ├── commands ├── docker-compose.yml ├── node └── Dockerfile └── server ├── Dockerfile ├── db ├── confg.d │ └── logging.cnf └── logs │ └── .gitignore ├── nginx ├── default └── supervisord.conf ├── php ├── php-fpm.conf ├── php.ini └── xdebug.ini └── start.sh /.env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # See https://docs.docker.com/compose/environment-variables/#the-env-file 4 | 5 | # Nginx 6 | NGINX_HOST=localhost 7 | APP_PORT=8080 8 | 9 | # PHPMyAdmin 10 | PHP_MY_ADMIN_PORT=8081 11 | 12 | # MySQL 13 | DB_PORT=3306 14 | MYSQL_VERSION=5.7 15 | MYSQL_ROOT_PASSWORD=secret 16 | MYSQL_DATABASE=homestead 17 | MYSQL_USER=homestead 18 | MYSQL_PASSWORD=secret 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Global 2 | .*.swp 3 | .DS_Store 4 | data/ 5 | 6 | # SSL Certs 7 | etc/ssl/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker development environment PHP/Laravel 🐳 2 | 3 | > بيئة تطويرية كاملة لبناء مشاريع بي اج بي بستخدام دوكر 4 | 5 | Included Features: 6 | 7 | - Nginx 8 | - MySQL 9 | - PHP-FPM 10 | - PHPMyAdmin 11 | - Nodejs (including npm, yarn) 12 | - Composer 13 | 14 | ## Important Instructions | تعليمات مهمة 💁‍♂️ 15 | 16 | Firs thing you need to do is to Make sure you have all these before you install this project 17 | 18 | > قبل تنزيل المشروع تاكد من تنزيل وتنصيب البرامج التالية 19 | 20 | - [Git](https://git-scm.com/downloads) 21 | - [Docker](https://docs.docker.com/engine/installation/) 22 | - [Docker Compose](https://docs.docker.com/compose/install/) 23 | 24 | Then check if you install them correctly running the following commands : 25 | 26 | > تحقق اذا قمت بتثبيتهم بشكل صحيح بستخدام الأوامر التالية 27 | 28 | - Git 29 | ```sh 30 | git --version # للتاكد من نسخة الكيت 31 | ``` 32 | - Docker 33 | ```sh 34 | docker -v # للتاكد من نسخة الدوكر 35 | ``` 36 | - Docker Compose 37 | ```sh 38 | docker-compose -v # للتاكد من نسخة دوكر كمبوس 39 | ``` 40 | 41 | ## Install the project | تحميل المشروع ⛷ 42 | > بكون ممنون اذا احد الاخوه يقوم يترجمة هذا الجزء لان ماعندي وقت فراغ 43 | 44 | If you already have an exsiting Laravel Project, skip step 1 45 | 1. Install a fresh copy of laravel using 46 | ```sh 47 | # using Laravel installer 48 | laravel new my-laravel-app 49 | 50 | # OR using Composer 51 | composer create-project --prefer-dist laravel/laravel my-laravel-app 52 | 53 | # OR using gitHub repository 54 | git clone https://github.com/laravel/laravel.git my-laravel-app 55 | ``` 56 | 57 | 2. change into an existing project folder 58 | ```sh 59 | cd my-laravel-app 60 | ``` 61 | 62 | 3. Now, let's check if git is already initialized in our laravel projet 63 | 64 | ```sh 65 | git status 66 | ``` 67 | If you get this error message: 68 | > fatal: Not a git repository (or any of the parent directories): .git 69 | 70 | that means your laravel projet you are currently in is not being tracked by git. In that case, initialize git inside your project folder by typing 71 | 72 | ```sh 73 | git init 74 | ``` 75 | 76 | 4. Now, let add our `Laravel-Docker` project as a `submodule` to our laravel project and tracking the `master` branch using: 77 | > حمل المشروع 78 | 79 | ```sh 80 | # Adds a new submodule into our project and define that the master branch should be tracked 81 | git submodule add -b master git@github.com:code2gether/laravel-docker.git docker 82 | # Initialize submodule configuration 83 | git submodule init 84 | 85 | # If you already done steps above and want to fetch new update from Laravel Docker project use: 86 | git submodule update --remote 87 | ``` 88 | 89 | ## Run the application | تشغيل المشروع 🚀 90 | 91 | To start the application run the following commands : 92 | 93 | > لبدء تشغيل التطبيق يجب تنفيذ الأوامر التالية 94 | 95 | 1. Change project directory 96 | > ادخل لملف المشروع 97 | 98 | ```sh 99 | cd docker 100 | ``` 101 | 102 | 2. Spin up all docker containers 103 | 104 | > لسحب كل الصورة للبرامج المطلوبة, ,قد تستغرق بعض الوقت 105 | 106 | ```sh 107 | docker-compose up -d 108 | # You need to be patient, this might take a several minutes 🐢 109 | ``` 110 | 111 | 3. If you want to attach yourself to the logs of all running services by running this command : 112 | 113 | > لكل الحاويات logs لمشاهدة 114 | 115 | ```sh 116 | docker-compose logs -f -t 117 | # whereas -f means you follow the log output and the -t option gives you nice timestamps 118 | # يقوم بعرض الوقت والتاريخ بشكل مفهوم -t يقوم بتتبع النتائج بالوقت الحقيقي و -f بينما 119 | ``` 120 | 121 | 4. If there is no `.env` file insde `project` directory, then make a new copy using: 122 | > تحتاج لعمل نسخة للملف env في حال اذا كال المشروع لايحتوي على ملف 123 | 124 | ```sh 125 | cp .env.example .env 126 | ``` 127 | 128 | 5. Copy `DB_HOST`, `DB_PORT`, `DB_DATABASE`, `DB_USERNAME`, `DB_PASSWORD` from docker's `.env` file . 129 | > للدوكر env انسخ اعدادات قاعدة البيانات من ملف 130 | 131 | ```sh 132 | DB_PORT=3306 133 | MYSQL_VERSION=5.7 134 | MYSQL_ROOT_PASSWORD=secret 135 | MYSQL_DATABASE=homestead 136 | MYSQL_USER=homestead 137 | MYSQL_PASSWORD=secret 138 | ``` 139 | 140 | ```sh 141 | # You can udpate configuration above as well but dont forget to run: 142 | # او تغير الباسورد لقاعدة البيانات ... الخ ولكن لاتنسى تنفيذ امر mysql وايضا تستطيع تحديث الاعدادات في اي وقت مثلا تغير نسخة 143 | 144 | docker-compose up --build -d 145 | ``` 146 | > 147 | 6. If you need to generate new laravel key, this can be done inside the container using: 148 | 149 | > في حالة اذ تحتاج لتوليد مفتاح جديد لمشروعك نفذ الامر التالي 150 | 151 | ```sh 152 | docker-compose exec app php artisan key:generate 153 | #or 154 | ./commands artisan key:generate 155 | # ./commands: ملف يحتوي على اوامر مختصره لكل حاوية 156 | ``` 157 | 158 | 7. The application has been baked, its dinner time 🍔. Now you can open the following in your browser: 159 | 160 | > تم تجهيز البيئة المطلوبة ، يمكنك زيارة الروابط التالية 161 | 162 | - Laravel Applicaion: [http://localhost:8080](http://localhost:8080) 163 | - PHPMyAdmin: [http://localhost:8081](http://localhost:8081/) 164 | 165 | ## Useful Commands 💡🐳 166 | 167 | Inside `commands` shell file, you can fine many useful commands to speedup your workflow. Lets see how to use them: 168 | 169 | > داخل ملف الاوامر يوجد مختصرات جاهزة لاوامر تخص دوكر لتسريع عملك 170 | 171 | - To startup containers 172 | 173 | ```sh 174 | # لتشغيل كل الحاويات المطلوبة 175 | ./commands start 176 | ``` 177 | 178 | - To stop all containers but don't remove them 179 | 180 | ```sh 181 | # لإيقاف كل حاويات دون أن تقوم بإزالتها 182 | ./commands stop 183 | ``` 184 | 185 | - To stop and remove all stopped docker containers and volumes 186 | 187 | ```sh 188 | # لإيقاف وازالة كل حاويات. 189 | ./commands remove 190 | 191 | # ملاحظة: في حالة تنفيذ هذا الامر تحتاج للانترنيت لتحميل الصور المطلوبة من جديد 192 | ``` 193 | 194 | - To view logs of all running services 195 | 196 | ```sh 197 | # لكل الحاويات logs لمشاهدة 198 | ./commands logs 199 | ``` 200 | 201 | - To require any package to your Laravel project using composer 202 | 203 | 204 | ```sh 205 | # لتنزيل اي مكتبة لمشروع لارافل 206 | ./commands composer require nesbot/carbon 207 | 208 | # Shortcut 209 | ./commands comp require nesbot/carbon 210 | # مختصر لامر السابق 211 | ``` 212 | 213 | - To use `artisan` command for doing anything 214 | ```sh 215 | # لتنفيذ اوامر لارافل 216 | ./commands artisan make:auth 217 | # OR 218 | ./commands artisan migrate 219 | 220 | # Shortcut | مختصر لامر السابق 221 | ./commands art make:auth 222 | ``` 223 | 224 | - To monitor containers health in formatted way using containers name 225 | ```sh 226 | # لمراقبة حالة الحاويات بشكل مباشر 227 | ./commands stats 228 | ``` 229 | 230 | - When you working with Frontend development, you can use following commands: 231 | ```sh 232 | # npm او yarn لتنزيل مكتبات فرونت اند بستخدام احدى الادوات 233 | ./commands yarn add react 234 | 235 | # OR 236 | ./commands npm install --save react 237 | ``` 238 | -------------------------------------------------------------------------------- /commands: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ $# -gt 0 ]; then 4 | 5 | if [ "$1" == "rebuild" ]; then 6 | docker-compose up --build -d 7 | 8 | elif [ "$1" == "start" ]; then 9 | docker-compose up -d 10 | 11 | elif [ "$1" == "stop" ]; then 12 | docker-compose stop 13 | 14 | elif [ "$1" == "remove" ]; then 15 | docker-compose down -v 16 | 17 | elif [ "$1" == "logs" ]; then 18 | docker-compose logs -f -t 19 | 20 | elif [ "$1" == "stats" ]; then 21 | docker stats $(docker inspect -f '{{.Name}}' $(docker ps -q) | cut -c 2-) 22 | 23 | elif [ "$1" == "artisan" ] || [ "$1" == "art" ]; then 24 | shift 1 25 | docker-compose exec \ 26 | app \ 27 | php artisan "$@" 28 | elif [ "$1" == "mysql" ]; then 29 | shift 1 30 | docker-compose exec \ 31 | db \ 32 | bash -c 'MYSQL_PWD=$MYSQL_ROOT_PASSWORD mysql -u root $MYSQL_DATABASE' 33 | 34 | elif [ "$1" == "composer" ] || [ "$1" == "comp" ]; then 35 | shift 1 36 | docker-compose exec \ 37 | app \ 38 | composer "$@" 39 | 40 | elif [ "$1" == "npm" ]; then 41 | shift 1 42 | docker-compose run --rm \ 43 | node \ 44 | npm "$@" 45 | 46 | elif [ "$1" == "yarn" ]; then 47 | shift 1 48 | docker-compose run --rm \ 49 | node \ 50 | yarn "$@" 51 | 52 | elif [ "$1" == "exec" ]; then 53 | shift 1 54 | docker exec -it "$@" 55 | 56 | else 57 | docker-compose "$@" 58 | fi 59 | 60 | else 61 | docker-compose ps 62 | fi 63 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | #NGNIX & PHP IMAGE 4 | app: 5 | build: 6 | context: ./server 7 | dockerfile: Dockerfile 8 | image: laravel-docker/app:latest 9 | networks: 10 | - appnet 11 | volumes: 12 | - ../:/var/www/html 13 | ports: 14 | - ${APP_PORT}:80 15 | working_dir: /var/www/html 16 | 17 | #REDIS IMAGE 18 | cache: 19 | image: redis:alpine 20 | networks: 21 | - appnet 22 | volumes: 23 | - cachedata:/data 24 | 25 | # MYSQL IMAGE 26 | db: 27 | image: mysql:${MYSQL_VERSION} 28 | environment: 29 | MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} 30 | MYSQL_DATABASE: ${MYSQL_DATABASE} 31 | MYSQL_USER: ${MYSQL_USER} 32 | MYSQL_PASSWORD: ${MYSQL_PASSWORD} 33 | ports: 34 | - ${DB_PORT}:3306 35 | networks: 36 | - appnet 37 | volumes: 38 | - dbdata:/var/lib/mysql 39 | 40 | # Nodejs IMAGE 41 | node: 42 | build: 43 | context: ./node 44 | dockerfile: Dockerfile 45 | image: laravel-docker/node:latest 46 | networks: 47 | - appnet 48 | volumes: 49 | - ../:/opt 50 | working_dir: /opt 51 | command: echo NodeJS is here 52 | 53 | # PHPMyAdmin Image 54 | myadmin: 55 | image: phpmyadmin/phpmyadmin 56 | ports: 57 | - ${PHP_MY_ADMIN_PORT}:80 58 | environment: 59 | MYSQL_USER: ${MYSQL_USER} 60 | MYSQL_PASSWORD: ${MYSQL_PASSWORD} 61 | depends_on: 62 | - db 63 | networks: 64 | - appnet 65 | 66 | networks: 67 | appnet: 68 | driver: bridge 69 | volumes: 70 | dbdata: 71 | driver: local 72 | cachedata: 73 | driver: local 74 | -------------------------------------------------------------------------------- /node/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:latest 2 | 3 | LABEL maintainer="Ahmed Abdulrahman" 4 | 5 | ARG uid=999 6 | 7 | RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ 8 | && echo "deb http://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ 9 | && apt-get update \ 10 | && apt-get install -y git yarn \ 11 | && apt-get -y autoremove \ 12 | && apt-get clean \ 13 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 14 | 15 | RUN usermod -u $uid node 16 | -------------------------------------------------------------------------------- /server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | LABEL maintainer="Ahmed Abdulrahman" 4 | 5 | RUN useradd -ms /bin/bash -u 1337 laravel 6 | WORKDIR /var/www/html 7 | 8 | ENV DEBIAN_FRONTEND=noninteractive 9 | ENV TZ=UTC 10 | RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 11 | 12 | RUN set -x \ 13 | && apt-get update && apt-get install -y gnupg gosu \ 14 | && gosu nobody true 15 | 16 | RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ 17 | && echo "deb http://ppa.launchpad.net/nginx/development/ubuntu bionic main" > /etc/apt/sources.list.d/ppa_nginx_mainline.list \ 18 | && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C \ 19 | && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C \ 20 | && apt-get update \ 21 | && apt-get install -y curl zip unzip git supervisor sqlite3 \ 22 | nginx php7.3-fpm php7.3-cli \ 23 | php7.3-pgsql php7.3-sqlite3 php7.3-gd \ 24 | php7.3-curl php7.3-memcached \ 25 | php7.3-imap php7.3-mysql php7.3-mbstring \ 26 | php7.3-xml php7.3-zip php7.3-bcmath php7.3-soap \ 27 | php7.3-intl php7.3-readline php7.3-xdebug \ 28 | php7.3-msgpack php7.3-igbinary php7.3-ldap \ 29 | && mkdir /run/php \ 30 | && apt-get -y autoremove \ 31 | && apt-get -y autoclean \ 32 | && rm -rf /var/lib/apt/lists/* /var/lib/cache/* /var/lib/log/* /tmp/* /var/tmp/* \ 33 | && echo "daemon off;" >> /etc/nginx/nginx.conf 34 | 35 | # Install composer 36 | RUN curl -sS https://getcomposer.org/installer | \ 37 | php -- --install-dir=/usr/local/bin --filename=composer \ 38 | mv composer.par /usr/local/bin/composer 39 | 40 | RUN ln -sf /dev/stdout /var/log/nginx/access.log \ 41 | && ln -sf /dev/stderr /var/log/nginx/error.log 42 | 43 | COPY nginx/default /etc/nginx/sites-available/default 44 | COPY nginx/supervisord.conf /etc/supervisor/conf.d/supervisord.conf 45 | COPY php/php-fpm.conf /etc/php/7.3/fpm/php-fpm.conf 46 | COPY php/xdebug.ini /etc/php/7.3/mods-available/xdebug.ini 47 | COPY php/php.ini /etc/php/7.3/fpm/conf.d/99-php.ini 48 | 49 | EXPOSE 80 50 | 51 | ADD start.sh /usr/bin/start 52 | RUN chmod +x /usr/bin/start 53 | 54 | ENTRYPOINT ["start"] 55 | -------------------------------------------------------------------------------- /server/db/confg.d/logging.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | general-log = On 3 | general-log-file = /var/log/mysql/mysql.log -------------------------------------------------------------------------------- /server/db/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /server/nginx/default: -------------------------------------------------------------------------------- 1 | # Nginx configuration 2 | 3 | server { 4 | listen 80 default_server; 5 | 6 | server_name _; 7 | charset utf-8; 8 | 9 | root /var/www/html/public; 10 | index index.html index.htm index.php; 11 | 12 | error_log /var/log/nginx/error.log; 13 | access_log /var/log/nginx/access.log; 14 | 15 | location = /favicon.ico { log_not_found off; access_log off; } 16 | location = /robots.txt { log_not_found off; access_log off; } 17 | 18 | location / { 19 | try_files $uri $uri/ /index.php$is_args$args; 20 | } 21 | 22 | location ~ \.php$ { 23 | include snippets/fastcgi-php.conf; 24 | fastcgi_pass unix:/run/php/php7.2-fpm.sock; 25 | } 26 | 27 | location ~ /\.ht { 28 | deny all; 29 | } 30 | 31 | error_page 404 /index.php; 32 | } 33 | -------------------------------------------------------------------------------- /server/nginx/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:nginx] 5 | command=nginx 6 | stdout_logfile=/dev/stdout 7 | stdout_logfile_maxbytes=0 8 | stderr_logfile=/dev/stderr 9 | stderr_logfile_maxbytes=0 10 | 11 | [program:php-fpm] 12 | command=php-fpm7.3 13 | stdout_logfile=/dev/stdout 14 | stdout_logfile_maxbytes=0 15 | stderr_logfile=/dev/stderr 16 | stderr_logfile_maxbytes=0 -------------------------------------------------------------------------------- /server/php/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /var 16 | ; Default Value: none 17 | pid = /run/php/php7.3-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; into a local file. 22 | ; Note: the default prefix is /var 23 | ; Default Value: log/php-fpm.log 24 | error_log = /proc/self/fd/2 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | ;log_level = notice 43 | 44 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 45 | ; interval set by emergency_restart_interval then FPM will restart. A value 46 | ; of '0' means 'Off'. 47 | ; Default Value: 0 48 | ;emergency_restart_threshold = 0 49 | 50 | ; Interval of time used by emergency_restart_interval to determine when 51 | ; a graceful restart will be initiated. This can be useful to work around 52 | ; accidental corruptions in an accelerator's shared memory. 53 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 54 | ; Default Unit: seconds 55 | ; Default Value: 0 56 | ;emergency_restart_interval = 0 57 | 58 | ; Time limit for child processes to wait for a reaction on signals from master. 59 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 60 | ; Default Unit: seconds 61 | ; Default Value: 0 62 | ;process_control_timeout = 0 63 | 64 | ; The maximum number of processes FPM will fork. This has been designed to control 65 | ; the global number of processes when using dynamic PM within a lot of pools. 66 | ; Use it with caution. 67 | ; Note: A value of 0 indicates no limit 68 | ; Default Value: 0 69 | ; process.max = 128 70 | 71 | ; Specify the nice(2) priority to apply to the master process (only if set) 72 | ; The value can vary from -19 (highest priority) to 20 (lowest priority) 73 | ; Note: - It will only work if the FPM master process is launched as root 74 | ; - The pool process will inherit the master process priority 75 | ; unless specified otherwise 76 | ; Default Value: no set 77 | ; process.priority = -19 78 | 79 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 80 | ; Default Value: yes 81 | daemonize = no 82 | 83 | ; Set open file descriptor rlimit for the master process. 84 | ; Default Value: system defined value 85 | ;rlimit_files = 1024 86 | 87 | ; Set max core size rlimit for the master process. 88 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 89 | ; Default Value: system defined value 90 | ;rlimit_core = 0 91 | 92 | ; Specify the event mechanism FPM will use. The following is available: 93 | ; - select (any POSIX os) 94 | ; - poll (any POSIX os) 95 | ; - epoll (linux >= 2.5.44) 96 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 97 | ; - /dev/poll (Solaris >= 7) 98 | ; - port (Solaris >= 10) 99 | ; Default Value: not set (auto detection) 100 | ;events.mechanism = epoll 101 | 102 | ; When FPM is built with systemd integration, specify the interval, 103 | ; in seconds, between health report notification to systemd. 104 | ; Set to 0 to disable. 105 | ; Available Units: s(econds), m(inutes), h(ours) 106 | ; Default Unit: seconds 107 | ; Default value: 10 108 | ;systemd_interval = 10 109 | 110 | ;;;;;;;;;;;;;;;;;;;; 111 | ; Pool Definitions ; 112 | ;;;;;;;;;;;;;;;;;;;; 113 | 114 | ; Multiple pools of child processes may be started with different listening 115 | ; ports and different management options. The name of the pool will be 116 | ; used in logs and stats. There is no limitation on the number of pools which 117 | ; FPM can handle. Your system will tell you anyway :) 118 | 119 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 120 | ; files from a glob(3) pattern. This directive can be used everywhere in the 121 | ; file. 122 | ; Relative path can also be used. They will be prefixed by: 123 | ; - the global prefix if it's been set (-p argument) 124 | ; - /usr otherwise 125 | include=/etc/php/7.3/fpm/pool.d/*.conf 126 | 127 | ; Clear environment in FPM workers. Prevents arbitrary environment variables from 128 | ; reaching FPM worker processes by clearing the environment in workers before env 129 | ; vars specified in this pool configuration are added. 130 | clear_env=false -------------------------------------------------------------------------------- /server/php/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | ; Maximum allowed size for uploaded files. 3 | ; http://php.net/upload-max-filesize 4 | upload_max_filesize = 100M 5 | 6 | ; Maximum size of POST data that PHP will accept. 7 | ; Its value may be 0 to disable the limit. It is ignored if POST data reading 8 | ; is disabled through enable_post_data_reading. 9 | ; http://php.net/post-max-size 10 | post_max_size = 100M -------------------------------------------------------------------------------- /server/php/xdebug.ini: -------------------------------------------------------------------------------- 1 | zend_extension=xdebug.so 2 | xdebug.remote_enable=1 3 | xdebug.remote_handler=dbgp 4 | xdebug.remote_port=9000 5 | xdebug.remote_autostart=1 6 | xdebug.remote_connect_back=0 7 | xdebug.idekey=docker 8 | xdebug.remote_host=192.168.1.2 9 | xdebug.max_nesting_level = 500 -------------------------------------------------------------------------------- /server/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## 4 | # Ensure /.composer is writable 5 | # 6 | chmod -R ugo+rw /.composer 7 | 8 | ## 9 | # Run a command or start supervisord 10 | # 11 | if [ $# -gt 0 ];then 12 | # If we passed a command, run it 13 | exec "$@" 14 | else 15 | # Otherwise start supervisord 16 | /usr/bin/supervisord 17 | fi --------------------------------------------------------------------------------