├── .env.dist ├── .gitignore ├── README.md ├── build ├── .commands ├── LICENSE ├── doc │ ├── custom.md │ └── schema.png ├── elk │ └── logstash │ │ ├── logstash.conf │ │ └── patterns │ │ ├── default.conf │ │ ├── nginx.conf │ │ └── symfony.conf ├── nginx │ ├── Dockerfile │ ├── clinicSMF4.conf │ ├── clinic_ci3.conf │ ├── cpanel.conf │ ├── doktor_bul.conf │ ├── nginx.conf │ ├── symfony.conf │ └── symfony4tutorial.conf └── php7-fpm │ ├── Dockerfile │ ├── cfg │ └── custom.ini │ └── utils │ ├── .bashrc │ ├── id_rsa │ └── id_rsa.pub └── docker-compose.yml /.env.dist: -------------------------------------------------------------------------------- 1 | # Symfony application's path (absolute or relative) 2 | SYMFONY_APP_PATH=../path/to/symfony/folder 3 | 4 | # MySQL 5 | MYSQL_ROOT_PASSWORD=root 6 | MYSQL_DATABASE=mydb 7 | MYSQL_USER=user 8 | MYSQL_PASSWORD=userpass 9 | 10 | # Timezone 11 | TIMEZONE=Europe/Istanbul 12 | 13 | # GIT GLOBAL CONFIG 14 | GIT_USER_NAME=Your Name 15 | GIT_USER_EMAIL=email@domain.ltd 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.data 3 | .env 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Symfony (PHP7-FPM - NGINX - MySQL - ELK) 2 | 3 | Based on maxpou/docker-symfony. Thanks for great work. 4 | 5 | This Docker uses only official images - no unknown flavour included. 6 | 7 | Ready to eat Symfony environment with: 8 | 9 | * Nginx 1.6.2 10 | * PHP 7.1.12 FPM + Opcache + Xdebug 11 | * Mysql 5.7.2 12 | * ELK (Elasticsearch - Logstash - Kibana) 13 | * PHPMyAdmin v4.7.7 14 | * Git v2.1.4 15 | * Node v8.9.3 16 | * Npm v5.5.1 17 | * Yarn v1.3.2 18 | * Composer v1.5.6 19 | * Symfony 3.4.x & 4.x compatible 20 | * Easy php ini_settings management 21 | * Automated Timezone via `.env` file 22 | * Automated Global Git Configuration via `.env` file 23 | * Pre-deployed .bashrc with colours and useful shortcuts 24 | * Fixed IP Addresses to ensure you'll always have same IP for containers, especially for MySQL. 25 | * `.data` folder (being created automatically) to ensure persistant data (logs, databases, etc.) 26 | * Unified Working Directory: You will be working at `/var/www/symfony` whatever project folder you mount. 27 | * and more.. Check Dockerfiles and configuration files to know 100% what's going on. 28 | 29 | ![](doc/schema.png) 30 | 31 | Docker-symfony gives you everything you need for developing Symfony application. This complete stack run with docker and [docker-compose (1.7 or higher)](https://docs.docker.com/compose/). 32 | 33 | ## Installation 34 | 35 | 1. Create a `.env` from the `.env.dist` file. Adapt it according to your symfony application 36 | 37 | ```bash 38 | cp .env.dist .env 39 | ``` 40 | 41 | 42 | 2. Build/run containers with (with and without detached mode) 43 | 44 | ```bash 45 | $ docker-compose build 46 | $ docker-compose up -d 47 | ``` 48 | 49 | 3. Update your system host file (add myapp.local) 50 | 51 | Normally all you need is to set your `myapp.local` domain to `127.0.0.1` in your `/etc/hosts` file on host machine. 52 | 53 | ```bash 54 | # UNIX only: get containers IP address and update host (replace IP according to your configuration) (on Windows, edit C:\Windows\System32\drivers\etc\hosts) 55 | $ sudo echo $(docker network inspect bridge | grep Gateway | grep -o -E '[0-9\.]+') "myapp.local" >> /etc/hosts 56 | ``` 57 | 58 | **Note:** For **OS X**, please take a look [here](https://docs.docker.com/docker-for-mac/networking/) and for **Windows** read [this](https://docs.docker.com/docker-for-windows/#/step-4-explore-the-application-and-run-examples) (4th step). 59 | 60 | 4. Work with your Symfony app located in any folder thanks to `.env` file. 61 | 62 | In this point, I advice you to setup a utility to open a /bin/bash line in containers because you will do it a lot :) 63 | [docker-ssh-automator](https://github.com/yahyaerturan/docker-ssh-automator) provides a very easy tool to get in containers. 64 | 65 | Simply type `docker-ssh` to get an option list for available containers. Click the number, and you are in. 66 | 67 | To work with Symfony, you need to get in respected `php` contanier. 68 | 69 | 5. Enjoy :-) 70 | 71 | ## Usage 72 | 73 | Just run `docker-compose up -d`, then: 74 | 75 | * Symfony app: visit [myapp.local](http://myapp.local) 76 | * Symfony dev mode: visit [myapp.local/app_dev.php](http://myapp.local/app_dev.php) 77 | * Logs (Kibana): [myapp.local:81](http://myapp.local:81) 78 | * Logs (files location): logs/nginx and logs/symfony 79 | 80 | ## How it works? 81 | 82 | Have a look at the `docker-compose.yml` file, here are the `docker-compose` built images: 83 | 84 | * `db`: This is the MySQL database container, 85 | * `php`: This is the PHP-FPM container in which the application volume is mounted, 86 | * `nginx`: This is the Nginx webserver container in which application volume is mounted too, 87 | * `elk`: This is a ELK stack container which uses Logstash to collect logs, send them into Elasticsearch and visualize them with Kibana. 88 | * `phpmyadmin`: This is a PHPMyAdmin container to manage your databases. 89 | 90 | This results in the following running containers: 91 | 92 | ```bash 93 | $ docker-compose ps 94 | Name Command State Ports 95 | -------------------------------------------------------------------------------------------------- 96 | dockersymfony_db_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp 97 | dockersymfony_elk_1 /usr/bin/supervisord -n -c ... Up 0.0.0.0:81->80/tcp 98 | dockersymfony_nginx_1 nginx Up 0.0.0.0:80->80/tcp, 443/tcp 99 | dockersymfony_php_1 docker-php-entrypoint php-fpm Up 0.0.0.0:9000->9000/tcp 100 | dockersymfony_phpmyadmin_1 /run.sh phpmyadmin Up 0.0.0.0:8080->80/tcp 101 | ``` 102 | 103 | ## Useful commands 104 | 105 | ```bash 106 | # bash commands 107 | $ docker-compose exec php bash 108 | 109 | # Retrieve an IP Address (here for the nginx container) 110 | $ docker inspect --format '{{ .NetworkSettings.Networks.dockersymfony_default.IPAddress }}' $(docker ps -f name=nginx -q) 111 | $ docker inspect $(docker ps -f name=nginx -q) | grep IPAddress 112 | 113 | # MySQL commands 114 | $ docker-compose exec db mysql -uroot -p"root" 115 | 116 | # F***ing cache/logs folder 117 | $ sudo chmod -R 777 var/cache var/logs var/sessions # Symfony3 118 | 119 | # Check CPU consumption 120 | $ docker stats $(docker inspect -f "{{ .Name }}" $(docker ps -q)) 121 | 122 | # Delete all containers 123 | $ docker rm $(docker ps -aq) 124 | 125 | # Delete all images 126 | $ docker rmi $(docker images -q) 127 | ``` 128 | 129 | ## FAQ 130 | 131 | * Got this error: `ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running? 132 | If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.` ? 133 | Run `docker-compose up -d` instead. 134 | 135 | * Permission problem? See [this doc (Setting up Permission)](http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup) 136 | 137 | * How to config Xdebug? 138 | Xdebug is configured out of the box! 139 | Just config your IDE to connect port `9001` and id key `PHPSTORM` 140 | 141 | ## Contributing 142 | 143 | First of all, **thank you** for contributing ♥ 144 | If you find any typo/misconfiguration/... please send me a PR or open an issue. You can also ping me on [twitter](https://twitter.com/yahyaerturan). 145 | Also, while creating your Pull Request on GitHub, please write a description which gives the context and/or explains why you are creating it. 146 | -------------------------------------------------------------------------------- /build/.commands: -------------------------------------------------------------------------------- 1 | # To see IP address of of a container 2 | docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dockersymfony_db_1 3 | 4 | # To reset Host machine DNS resolver 5 | sudo killall -HUP mDNSResponder; 6 | 7 | docker exec -it dockersymfony_php_1 bash 8 | 9 | # List Container Names 10 | docker ps --format '{{.Names}}' 11 | 12 | -------------------------------------------------------------------------------- /build/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Maxence POUTORD 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build/doc/custom.md: -------------------------------------------------------------------------------- 1 | # How to customise this stack 2 | 3 | This document is not yet updated - maybe outdated for Symfony 3.4.x && Symfony 4.x 4 | 5 | * [Add PHPMyAdmin](#Add-phpmyadmin) 6 | * [Add Redis](#Add-redis) 7 | 8 | ## Add PHPMyAdmin 9 | 10 | 1. Update docker-compose.yml file and add the following lines: 11 | 12 | ```yml 13 | service: 14 | # ... 15 | phpmyadmin: 16 | image: phpmyadmin/phpmyadmin 17 | ports: 18 | - "8080:80" 19 | ``` 20 | 21 | 2. Visit: [myapp.local:8080](http://myapp.local:8080) 22 | 23 | ## Add Redis 24 | 25 | 1. Update docker-compose.yml file and add the following lines: 26 | 27 | ```yml 28 | service: 29 | # ... 30 | redis: 31 | image: redis:alpine 32 | ports: 33 | - 6379:6379 34 | ``` 35 | 36 | 2. Adapt your Symfony configuration file 37 | 38 | ```yml 39 | # path/to/your/symfony-project/app/config/parameters.yml 40 | parameters: 41 | #... 42 | redis_host: redis 43 | ``` 44 | 45 | :question: Using [SncRedis](https://github.com/snc/SncRedisBundle)? 46 | Your Symfony config file should be like this: 47 | 48 | ```yml 49 | snc_redis: 50 | clients: 51 | default: 52 | type: predis 53 | alias: default 54 | dsn: redis://%redis_host% 55 | ``` 56 | 57 | Access to redis-cli with: 58 | 59 | ```bash 60 | # Redis commands 61 | $ docker-compose exec redis redis-cli 62 | ``` 63 | -------------------------------------------------------------------------------- /build/doc/schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yahyaerturan/docker-symfony-flex/053feedb345fa5f02d7dc3233e861abbfdb12247/build/doc/schema.png -------------------------------------------------------------------------------- /build/elk/logstash/logstash.conf: -------------------------------------------------------------------------------- 1 | input { 2 | file { 3 | type => "nginx_access" 4 | path => "/var/log/nginx/symfony_access.log" 5 | start_position => beginning 6 | } 7 | file { 8 | type => "symfony_dev" 9 | path => "/var/www/symfony/var/log/dev.log" 10 | start_position => beginning 11 | } 12 | file { 13 | type => "symfony_prod" 14 | path => "/var/www/symfony/var/log/prod.log" 15 | start_position => beginning 16 | } 17 | } 18 | 19 | filter { 20 | if [type] == "nginx_access" { 21 | grok { 22 | patterns_dir => "./patterns" 23 | match => { "message" => "%{NGINXACCESS}"} 24 | } 25 | } 26 | else if [type] in ["symfony_dev", "symfony_prod"] { 27 | grok { 28 | patterns_dir => "./patterns" 29 | match => { "message" => "%{SYMFONY}"} 30 | } 31 | } 32 | } 33 | 34 | output { 35 | elasticsearch { 36 | host => "localhost" 37 | cluster => "logstash" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /build/elk/logstash/patterns/default.conf: -------------------------------------------------------------------------------- 1 | USERNAME [a-zA-Z0-9._-]+ 2 | USER %{USERNAME} 3 | INT (?:[+-]?(?:[0-9]+)) 4 | BASE10NUM (?[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+))) 5 | NUMBER (?:%{BASE10NUM}) 6 | BASE16NUM (?(?"(?>\\.|[^\\"]+)+"|""|(?>'(?>\\.|[^\\']+)+')|''|(?>`(?>\\.|[^\\`]+)+`)|``)) 17 | UUID [A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12} 18 | # Networking 19 | MAC (?:%{CISCOMAC}|%{WINDOWSMAC}|%{COMMONMAC}) 20 | CISCOMAC (?:(?:[A-Fa-f0-9]{4}\.){2}[A-Fa-f0-9]{4}) 21 | WINDOWSMAC (?:(?:[A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2}) 22 | COMMONMAC (?:(?:[A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}) 23 | IPV6 ((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)? 24 | IPV4 (?/(?>[\w_%!$@:.,-]+|\\.)*)+ 33 | TTY (?:/dev/(pts|tty([pq])?)(\w+)?/?(?:[0-9]+)) 34 | WINPATH (?>[A-Za-z]+:|\\)(?:\\[^\\?*]*)+ 35 | URIPROTO [A-Za-z]+(\+[A-Za-z+]+)? 36 | URIHOST %{IPORHOST}(?::%{POSINT:port})? 37 | # uripath comes loosely from RFC1738, but mostly from what Firefox 38 | # doesn't turn into %XX 39 | URIPATH (?:/[A-Za-z0-9$.+!*'(){},~:;=@#%_\-]*)+ 40 | #URIPARAM \?(?:[A-Za-z0-9]+(?:=(?:[^&]*))?(?:&(?:[A-Za-z0-9]+(?:=(?:[^&]*))?)?)*)? 41 | URIPARAM \?[A-Za-z0-9$.+!*'|(){},~@#%&/=:;_?\-\[\]]* 42 | URIPATHPARAM %{URIPATH}(?:%{URIPARAM})? 43 | URI %{URIPROTO}://(?:%{USER}(?::[^@]*)?@)?(?:%{URIHOST})?(?:%{URIPATHPARAM})? 44 | # Months: January, Feb, 3, 03, 12, December 45 | MONTH \b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\b 46 | MONTHNUM (?:0?[1-9]|1[0-2]) 47 | MONTHNUM2 (?:0[1-9]|1[0-2]) 48 | MONTHDAY (?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9]) 49 | # Days: Monday, Tue, Thu, etc... 50 | DAY (?:Mon(?:day)?|Tue(?:sday)?|Wed(?:nesday)?|Thu(?:rsday)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?) 51 | # Years? 52 | YEAR (?>\d\d){1,2} 53 | HOUR (?:2[0123]|[01]?[0-9]) 54 | MINUTE (?:[0-5][0-9]) 55 | # '60' is a leap second in most time standards and thus is valid. 56 | SECOND (?:(?:[0-5]?[0-9]|60)(?:[:.,][0-9]+)?) 57 | TIME (?!<[0-9])%{HOUR}:%{MINUTE}(?::%{SECOND})(?![0-9]) 58 | # datestamp is YYYY/MM/DD-HH:MM:SS.UUUU (or something like it) 59 | DATE_US %{MONTHNUM}[/-]%{MONTHDAY}[/-]%{YEAR} 60 | DATE_EU %{MONTHDAY}[./-]%{MONTHNUM}[./-]%{YEAR} 61 | ISO8601_TIMEZONE (?:Z|[+-]%{HOUR}(?::?%{MINUTE})) 62 | ISO8601_SECOND (?:%{SECOND}|60) 63 | TIMESTAMP_ISO8601 %{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?%{ISO8601_TIMEZONE}? 64 | DATE %{DATE_US}|%{DATE_EU} 65 | DATESTAMP %{DATE}[- ]%{TIME} 66 | TZ (?:[PMCE][SD]T|UTC) 67 | DATESTAMP_RFC822 %{DAY} %{MONTH} %{MONTHDAY} %{YEAR} %{TIME} %{TZ} 68 | DATESTAMP_RFC2822 %{DAY}, %{MONTHDAY} %{MONTH} %{YEAR} %{TIME} %{ISO8601_TIMEZONE} 69 | DATESTAMP_OTHER %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{TZ} %{YEAR} 70 | DATESTAMP_EVENTLOG %{YEAR}%{MONTHNUM2}%{MONTHDAY}%{HOUR}%{MINUTE}%{SECOND} 71 | # Syslog Dates: Month Day HH:MM:SS 72 | SYSLOGTIMESTAMP %{MONTH} +%{MONTHDAY} %{TIME} 73 | PROG (?:[\w._/%-]+) 74 | SYSLOGPROG %{PROG:program}(?:\[%{POSINT:pid}\])? 75 | SYSLOGHOST %{IPORHOST} 76 | SYSLOGFACILITY <%{NONNEGINT:facility}.%{NONNEGINT:priority}> 77 | HTTPDATE %{MONTHDAY}/%{MONTH}/%{YEAR}:%{TIME} %{INT} 78 | # Shortcuts 79 | QS %{QUOTEDSTRING} 80 | # Log formats 81 | SYSLOGBASE %{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}: 82 | COMMONAPACHELOG %{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-) 83 | COMBINEDAPACHELOG %{COMMONAPACHELOG} %{QS:referrer} %{QS:agent} 84 | # Log Levels 85 | LOGLEVEL ([Aa]lert|ALERT|[Tt]race|TRACE|[Dd]ebug|DEBUG|[Nn]otice|NOTICE|[Ii]nfo|INFO|[Ww]arn?(?:ing)?|WARN?(?:ING)?|[Ee]rr?(?:or)?|ERR?(?:OR)?|[Cc]rit?(?:ical)?|CRIT?(?:ICAL)?|[Ff]atal|FATAL|[Ss]evere|SEVERE|EMERG(?:ENCY)?|[Ee]merg(?:ency)?) -------------------------------------------------------------------------------- /build/elk/logstash/patterns/nginx.conf: -------------------------------------------------------------------------------- 1 | NGINXACCESS %{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{URIPATHPARAM:request}(?: HTTP/%{NUMBER:httpversion})?|-)" %{NUMBER:response} (?:%{NUMBER:bytes}|-) "(?:%{URI:referrer}|-)" %{QS:agent} %{NUMBER:request_time} %{NUMBER:upstream_response_time} %{NUMBER:gzip_ratio} (?:%{WORD:cache_hit}|-)%{GREEDYDATA} -------------------------------------------------------------------------------- /build/elk/logstash/patterns/symfony.conf: -------------------------------------------------------------------------------- 1 | VERYGREEDYDATA (.|\n)* 2 | 3 | SYMFONY_EXCEPTION [^:]* 4 | 5 | SYMFONY_LOG_TYPE request|security|app|profiler|doctrine|event 6 | SYMFONY_LOG_LEVEL DEBUG|INFO|WARNING|ERROR|CRITICAL|ALERT 7 | SYMFONY_LOG %{SYMFONY_LOG_TYPE:log_type}\.%{SYMFONY_LOG_LEVEL:log_level} 8 | 9 | SYMFONY_PARAMETER "[^"]*":( )?"[^"]*" 10 | SYMFONY_PARAMETERS (%{SYMFONY_PARAMETER}(, )?)* 11 | SYMFONY_CONTEXT {.*} 12 | SYMFONY_REQUEST_METHOD GET|POST|PUT|DELETE|HEAD|OPTIONS|CONNECT 13 | SYMFONY_REQUEST_PARAMETERS {"url":"%{GREEDYDATA:request_url}","ip":"%{IP:request_ip}","http_method":"%{SYMFONY_REQUEST_METHOD:request_method}"} 14 | 15 | SYMFONY_REQUEST_INFO Matched route "%{GREEDYDATA:route}" \(parameters: %{SYMFONY_PARAMETERS:parameters}\) 16 | SYMFONY_REQUEST_UNCAUGHT_EXCEPTION %{SYMFONY_EXCEPTION:exception}: %{VERYGREEDYDATA:exception_message} \(uncaught exception\) at %{VERYGREEDYDATA:exception_file} line %{NUMBER:exception_file_line} 17 | SYMFONY_REQUEST_CRITICAL Exception thrown when handling an exception \(ErrorException: %{GREEDYDATA:exception_message} in %{GREEDYDATA:exception_file} line %{NUMBER:exception_file_line}\) 18 | SYMFONY_SECURITY_WARNING_USER_MISSING Username "%{GREEDYDATA:user}" could not be found. 19 | SYMFONY_SECURITY_INFO_USER_AUTHENTICATED User "%{GREEDYDATA:user}" has been authenticated successfully 20 | SYMFONY_SECURITY_INFO_AUTHENTICATION_FAILED Authentication request failed: %{GREEDYDATA:authentication_fail_reason} 21 | SYMFONY_SECURITY_DEBUG Username "%{GREEDYDATA:user}" was reloaded from user provider. 22 | SYMFONY_EVENT_DEBUG_NOTIFICATION Notified event "%{GREEDYDATA:event}" to listener "%{GREEDYDATA:listener}". 23 | SYMFONY_EVENT_DEBUG_PROPAGATION_STOP Listener "%{GREEDYDATA:listener}" stopped propagation of the event "%{GREEDYDATA:event}". 24 | SYMFONY_DOCTRINE_DEBUG (?<=doctrine.DEBUG: ).* 25 | 26 | SYMFONY_REQUEST %{SYMFONY_REQUEST_INFO}|%{SYMFONY_REQUEST_UNCAUGHT_EXCEPTION}|%{SYMFONY_REQUEST_CRITICAL} 27 | SYMFONY_SECURITY %{SYMFONY_SECURITY_WARNING_USER_MISSING}|%{SYMFONY_SECURITY_INFO_USER_AUTHENTICATED}|%{SYMFONY_SECURITY_DEBUG}|%{SYMFONY_SECURITY_INFO_AUTHENTICATION_FAILED} 28 | SYMFONY_EVENT %{SYMFONY_EVENT_DEBUG_NOTIFICATION}|%{SYMFONY_EVENT_DEBUG_PROPAGATION_STOP} 29 | SYMFONY_DOCTRINE %{SYMFONY_DOCTRINE_DEBUG:doctrine_sql_query} 30 | SYMFONY_VARIOUS_INFO Write SecurityContext in the session|Reloading user from user provider.|Read SecurityContext from the session|Populated SecurityContext with an anonymous Token|Access is denied (and user is neither anonymous, nor remember-me)|Unable to store the profiler information.|Remember-me cookie accepted. 31 | 32 | SYMFONY_LOG_MESSAGE %{SYMFONY_REQUEST}|%{SYMFONY_SECURITY}|%{SYMFONY_EVENT}|%{SYMFONY_DOCTRINE}|%{SYMFONY_VARIOUS_INFO:log_various_info}|%{VERYGREEDYDATA:log_unparsed_message} 33 | 34 | SYMFONY ^\[%{TIMESTAMP_ISO8601:date}\] %{SYMFONY_LOG}: %{SYMFONY_LOG_MESSAGE:log_message} (\[\]|%{SYMFONY_CONTEXT:log_context}) (\[\]|%{SYMFONY_REQUEST_PARAMETERS:log_request}) -------------------------------------------------------------------------------- /build/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | 3 | MAINTAINER Yahya ERTURAN 4 | 5 | RUN apt-get update && apt-get install -y \ 6 | nginx 7 | 8 | ADD nginx.conf /etc/nginx/ 9 | ADD symfony.conf /etc/nginx/sites-available/ 10 | ADD cpanel.conf /etc/nginx/sites-available/ 11 | ADD clinic_ci3.conf /etc/nginx/sites-available/ 12 | ADD symfony4tutorial.conf /etc/nginx/sites-available/ 13 | ADD clinicSMF4.conf /etc/nginx/sites-available/ 14 | ADD doktor_bul.conf /etc/nginx/sites-available/ 15 | 16 | RUN ln -s /etc/nginx/sites-available/symfony.conf /etc/nginx/sites-enabled/symfony 17 | RUN ln -s /etc/nginx/sites-available/cpanel.conf /etc/nginx/sites-enabled/cpanel 18 | RUN ln -s /etc/nginx/sites-available/clinic_ci3.conf /etc/nginx/sites-enabled/clinic_ci3 19 | RUN ln -s /etc/nginx/sites-available/symfony4tutorial.conf /etc/nginx/sites-enabled/symfony4tutorial 20 | RUN ln -s /etc/nginx/sites-available/clinicSMF4.conf /etc/nginx/sites-enabled/clinicSMF4 21 | RUN ln -s /etc/nginx/sites-available/doktor_bul.conf /etc/nginx/sites-enabled/doktor_bul 22 | RUN rm /etc/nginx/sites-enabled/default 23 | 24 | RUN echo "upstream php-upstream { server php:9000; }" > /etc/nginx/conf.d/upstream.conf 25 | 26 | RUN usermod -u 1000 www-data 27 | 28 | CMD ["nginx"] 29 | 30 | EXPOSE 80 31 | EXPOSE 443 32 | -------------------------------------------------------------------------------- /build/nginx/clinicSMF4.conf: -------------------------------------------------------------------------------- 1 | server { 2 | server_name clinic-symfony4.local; 3 | root /var/www/clinicSMF4/public; 4 | 5 | location / { 6 | try_files $uri @rewriteapp; 7 | } 8 | 9 | location @rewriteapp { 10 | rewrite ^(.*)$ /index.php/$1 last; 11 | } 12 | 13 | location ~ ^/index\.php(/|$) { 14 | fastcgi_pass php-upstream; 15 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 16 | include fastcgi_params; 17 | # When you are using symlinks to link the document root to the 18 | # current version of your application, you should pass the real 19 | # application path instead of the path to the symlink to PHP 20 | # FPM. 21 | # Otherwise, PHP's OPcache may not properly detect changes to 22 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 23 | # for more information). 24 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 25 | fastcgi_param DOCUMENT_ROOT $realpath_root; 26 | fastcgi_param HTTPS off; 27 | # Prevents URIs that include the front controller. This will 404: 28 | # http://domain.tld/index.php/some-path 29 | # Remove the internal directive to allow URIs like this 30 | internal; 31 | } 32 | 33 | # return 404 for all other php files not matching the front controller 34 | # this prevents access to other php files you don't want to be accessible. 35 | location ~ \.php$ { 36 | return 404; 37 | } 38 | 39 | error_log /var/log/nginx/symfony_error.log; 40 | access_log /var/log/nginx/symfony_access.log; 41 | } 42 | -------------------------------------------------------------------------------- /build/nginx/clinic_ci3.conf: -------------------------------------------------------------------------------- 1 | server { 2 | server_name clinic-ci3.local; 3 | root /var/www/ClinicManagement/public; 4 | 5 | location / { 6 | try_files $uri @rewriteapp; 7 | } 8 | 9 | location @rewriteapp { 10 | rewrite ^(.*)$ /index.php/$1 last; 11 | } 12 | 13 | location ~ ^/index\.php(/|$) { 14 | fastcgi_pass php-upstream; 15 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 16 | include fastcgi_params; 17 | # When you are using symlinks to link the document root to the 18 | # current version of your application, you should pass the real 19 | # application path instead of the path to the symlink to PHP 20 | # FPM. 21 | # Otherwise, PHP's OPcache may not properly detect changes to 22 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 23 | # for more information). 24 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 25 | fastcgi_param DOCUMENT_ROOT $realpath_root; 26 | fastcgi_param HTTPS off; 27 | # Prevents URIs that include the front controller. This will 404: 28 | # http://domain.tld/index.php/some-path 29 | # Remove the internal directive to allow URIs like this 30 | internal; 31 | } 32 | 33 | # return 404 for all other php files not matching the front controller 34 | # this prevents access to other php files you don't want to be accessible. 35 | location ~ \.php$ { 36 | return 404; 37 | } 38 | 39 | error_log /var/log/nginx/symfony_error.log; 40 | access_log /var/log/nginx/symfony_access.log; 41 | } 42 | -------------------------------------------------------------------------------- /build/nginx/cpanel.conf: -------------------------------------------------------------------------------- 1 | server { 2 | server_name cpanel.local; 3 | root /var/www/cpanel_api; 4 | 5 | location / { 6 | try_files $uri @rewriteapp; 7 | } 8 | 9 | location @rewriteapp { 10 | rewrite ^(.*)$ /index.php/$1 last; 11 | } 12 | 13 | location ~ ^/index\.php(/|$) { 14 | fastcgi_pass php-upstream; 15 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 16 | include fastcgi_params; 17 | # When you are using symlinks to link the document root to the 18 | # current version of your application, you should pass the real 19 | # application path instead of the path to the symlink to PHP 20 | # FPM. 21 | # Otherwise, PHP's OPcache may not properly detect changes to 22 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 23 | # for more information). 24 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 25 | fastcgi_param DOCUMENT_ROOT $realpath_root; 26 | fastcgi_param HTTPS off; 27 | # Prevents URIs that include the front controller. This will 404: 28 | # http://domain.tld/index.php/some-path 29 | # Remove the internal directive to allow URIs like this 30 | internal; 31 | } 32 | 33 | # return 404 for all other php files not matching the front controller 34 | # this prevents access to other php files you don't want to be accessible. 35 | location ~ \.php$ { 36 | return 404; 37 | } 38 | 39 | error_log /var/log/nginx/symfony_error.log; 40 | access_log /var/log/nginx/symfony_access.log; 41 | } 42 | -------------------------------------------------------------------------------- /build/nginx/doktor_bul.conf: -------------------------------------------------------------------------------- 1 | server { 2 | server_name doktor-bul.local; 3 | root /var/www/doktor-bul/public; 4 | 5 | location / { 6 | try_files $uri @rewriteapp; 7 | } 8 | 9 | location @rewriteapp { 10 | rewrite ^(.*)$ /index.php/$1 last; 11 | } 12 | 13 | location ~ ^/index\.php(/|$) { 14 | fastcgi_pass php-upstream; 15 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 16 | include fastcgi_params; 17 | # When you are using symlinks to link the document root to the 18 | # current version of your application, you should pass the real 19 | # application path instead of the path to the symlink to PHP 20 | # FPM. 21 | # Otherwise, PHP's OPcache may not properly detect changes to 22 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 23 | # for more information). 24 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 25 | fastcgi_param DOCUMENT_ROOT $realpath_root; 26 | fastcgi_param HTTPS off; 27 | # Prevents URIs that include the front controller. This will 404: 28 | # http://domain.tld/index.php/some-path 29 | # Remove the internal directive to allow URIs like this 30 | internal; 31 | } 32 | 33 | # return 404 for all other php files not matching the front controller 34 | # this prevents access to other php files you don't want to be accessible. 35 | location ~ \.php$ { 36 | return 404; 37 | } 38 | 39 | error_log /var/log/nginx/symfony_error.log; 40 | access_log /var/log/nginx/symfony_access.log; 41 | } 42 | -------------------------------------------------------------------------------- /build/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes 4; 3 | pid /run/nginx.pid; 4 | 5 | events { 6 | worker_connections 2048; 7 | multi_accept on; 8 | use epoll; 9 | } 10 | 11 | http { 12 | server_tokens off; 13 | sendfile on; 14 | tcp_nopush on; 15 | tcp_nodelay on; 16 | keepalive_timeout 15; 17 | types_hash_max_size 2048; 18 | include /etc/nginx/mime.types; 19 | default_type application/octet-stream; 20 | access_log off; 21 | error_log off; 22 | gzip on; 23 | gzip_disable "msie6"; 24 | include /etc/nginx/conf.d/*.conf; 25 | include /etc/nginx/sites-enabled/*; 26 | open_file_cache max=100; 27 | } 28 | 29 | daemon off; 30 | -------------------------------------------------------------------------------- /build/nginx/symfony.conf: -------------------------------------------------------------------------------- 1 | server { 2 | server_name clinic-management.local; 3 | root /var/www/symfony/public; 4 | 5 | location / { 6 | try_files $uri @rewriteapp; 7 | } 8 | 9 | location @rewriteapp { 10 | rewrite ^(.*)$ /index.php/$1 last; 11 | } 12 | 13 | location ~ ^/index\.php(/|$) { 14 | fastcgi_pass php-upstream; 15 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 16 | include fastcgi_params; 17 | # When you are using symlinks to link the document root to the 18 | # current version of your application, you should pass the real 19 | # application path instead of the path to the symlink to PHP 20 | # FPM. 21 | # Otherwise, PHP's OPcache may not properly detect changes to 22 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 23 | # for more information). 24 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 25 | fastcgi_param DOCUMENT_ROOT $realpath_root; 26 | fastcgi_param HTTPS off; 27 | # Prevents URIs that include the front controller. This will 404: 28 | # http://domain.tld/index.php/some-path 29 | # Remove the internal directive to allow URIs like this 30 | internal; 31 | } 32 | 33 | # return 404 for all other php files not matching the front controller 34 | # this prevents access to other php files you don't want to be accessible. 35 | location ~ \.php$ { 36 | return 404; 37 | } 38 | 39 | error_log /var/log/nginx/symfony_error.log; 40 | access_log /var/log/nginx/symfony_access.log; 41 | } 42 | -------------------------------------------------------------------------------- /build/nginx/symfony4tutorial.conf: -------------------------------------------------------------------------------- 1 | server { 2 | server_name symfony4.local; 3 | root /var/www/symfony4tutorial/public; 4 | 5 | location / { 6 | try_files $uri @rewriteapp; 7 | } 8 | 9 | location @rewriteapp { 10 | rewrite ^(.*)$ /index.php/$1 last; 11 | } 12 | 13 | location ~ ^/index\.php(/|$) { 14 | fastcgi_pass php-upstream; 15 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 16 | include fastcgi_params; 17 | # When you are using symlinks to link the document root to the 18 | # current version of your application, you should pass the real 19 | # application path instead of the path to the symlink to PHP 20 | # FPM. 21 | # Otherwise, PHP's OPcache may not properly detect changes to 22 | # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 23 | # for more information). 24 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 25 | fastcgi_param DOCUMENT_ROOT $realpath_root; 26 | fastcgi_param HTTPS off; 27 | # Prevents URIs that include the front controller. This will 404: 28 | # http://domain.tld/index.php/some-path 29 | # Remove the internal directive to allow URIs like this 30 | internal; 31 | } 32 | 33 | # return 404 for all other php files not matching the front controller 34 | # this prevents access to other php files you don't want to be accessible. 35 | location ~ \.php$ { 36 | return 404; 37 | } 38 | 39 | error_log /var/log/nginx/symfony_error.log; 40 | access_log /var/log/nginx/symfony_access.log; 41 | } 42 | -------------------------------------------------------------------------------- /build/php7-fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | # See https://github.com/docker-library/php/blob/master/7.1/jessie/fpm/Dockerfile 2 | FROM php:7.1-fpm 3 | ARG TIMEZONE 4 | ARG DEBIAN_FRONTEND=noninteractive 5 | 6 | MAINTAINER Yahya ERTURAN 7 | 8 | ENV NVM_DIR /usr/local/nvm 9 | ENV NODE_VERSION 8.9.3 10 | 11 | 12 | COPY ./utils/.bashrc /root/ 13 | RUN /bin/bash -c "source /root/.bashrc" 14 | 15 | RUN apt-get update -qq && apt-get install -y -qq \ 16 | openssl \ 17 | git \ 18 | nano \ 19 | apt-transport-https \ 20 | curl \ 21 | zip \ 22 | unzip; 23 | 24 | # soap => dependency: libxml2-dev 25 | # mcrypt => dependency: libmcrypt-dev 26 | # ftp => dependency: libssl-dev 27 | # intl => dependency: libicu-dev 28 | # xsl => dependency: libxslt-dev 29 | # gd => dependecy: libfreetype6-dev libjpeg62-turbo-dev libpng-dev 30 | RUN apt-get install -y -qq \ 31 | libxml2-dev \ 32 | libmcrypt-dev \ 33 | libssl-dev \ 34 | libicu-dev \ 35 | libxslt-dev \ 36 | libfreetype6-dev \ 37 | libjpeg62-turbo-dev \ 38 | libpng-dev 39 | 40 | # Add Yarn as PPA 41 | RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - 42 | RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list 43 | RUN apt-get -qq update 44 | 45 | # Config Git Globally 46 | RUN git config --global user.name "${GIT_USER_NAME}" 47 | RUN git config --global user.email "${GIT_USER_EMAIL}" 48 | RUN git config --global core.fileMode false 49 | RUN git config --global color.ui true 50 | 51 | # Install Composer 52 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 53 | RUN composer --version 54 | 55 | # Install NVM 56 | # https://github.com/creationix/nvm#install-script 57 | RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash 58 | 59 | # install node and npm 60 | RUN . $NVM_DIR/nvm.sh \ 61 | && nvm install $NODE_VERSION \ 62 | && nvm alias default $NODE_VERSION \ 63 | && nvm use default 64 | 65 | # add node and npm to path so the commands are available 66 | ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules 67 | ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH 68 | 69 | RUN /bin/bash -c "npm upgrade minimatch@3 graceful-fs@4 --global" 70 | 71 | # Intall Yarn 72 | RUN apt-get install -y -qq yarn 73 | 74 | # Set timezone 75 | RUN ln -snf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && echo ${TIMEZONE} > /etc/timezone 76 | RUN printf '[PHP]\ndate.timezone = "%s"\n', ${TIMEZONE} > /usr/local/etc/php/conf.d/tzone.ini 77 | RUN "date" 78 | 79 | # Type docker-php-ext-install to see available extensions 80 | # Possible values for ext-name: 81 | # bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp 82 | # gd gettext gmp hash iconv imap interbase intl json ldap mbstring mcrypt mysqli 83 | # oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite 84 | # pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets 85 | # spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip 86 | 87 | RUN docker-php-ext-install gettext zip xsl pdo pdo_mysql mysqli intl hash && docker-php-ext-install -j$(nproc) iconv mcrypt \ 88 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 89 | && docker-php-ext-install -j$(nproc) gd opcache 90 | 91 | # Installed Extension with this configuration 92 | # Core hash pdo_mysql standard 93 | # ctype iconv pdo_sqlite tokenizer 94 | # curl json Phar xml 95 | # date libxml posix xmlreader 96 | # dom mbstring readline xmlwriter 97 | # fileinfo mcrypt Reflection xsl 98 | # filter mysqlnd session zip 99 | # ftp openssl SimpleXML zlib 100 | # gd pcre SPL [Zend Modules] 101 | # gettext PDO sqlite3 Zend OPcache 102 | 103 | 104 | # Install and enable xdebug 105 | # RUN pecl install xdebug 106 | # RUN docker-php-ext-enable xdebug 107 | # RUN echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 108 | # RUN echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 109 | # RUN echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 110 | # RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 111 | # RUN echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 112 | # RUN echo "xdebug.idekey=\"PHPSTORM\"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 113 | # RUN echo "xdebug.remote_port=9001" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini 114 | 115 | # Disable opcahce temporarily 116 | # RUN mkdir -p /usr/local/etc/php/conf.d/disabled && mv /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini /usr/local/etc/php/conf.d/disabled/docker-php-ext-opcache.ini 117 | 118 | RUN mkdir -p /root/.ssh 119 | COPY ./utils/id_rsa /root/.ssh 120 | COPY ./utils/id_rsa.pub /root/.ssh 121 | 122 | WORKDIR /var/www/symfony 123 | -------------------------------------------------------------------------------- /build/php7-fpm/cfg/custom.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | ; Memory 3 | memory_limit = 1024M 4 | 5 | ; Timeouts 6 | max_execution_time = 180 7 | max_input_time = 180 8 | ; Uploads 9 | post_max_size = 32M 10 | upload_max_filesize = 16M 11 | 12 | ; Vars 13 | max_input_vars = 8000 14 | 15 | ; Error reporting 16 | error_reporting = E_ALL 17 | display_errors = On 18 | track_errors = On 19 | -------------------------------------------------------------------------------- /build/php7-fpm/utils/.bashrc: -------------------------------------------------------------------------------- 1 | export PS1="\[\033[32m\]\h:\[\033[33;1m\]\W\[\033[m\] \$ " 2 | export TERM=xterm-color 3 | export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' 4 | export CLICOLOR=1 5 | export LSCOLORS=ExFxBxDxCxegedabagacad 6 | 7 | export PATH=$PATH:$HOME/bin 8 | 9 | # Alias definitions. 10 | # You may want to put all your additions into a separate file like 11 | # ~/.bash_aliases, instead of adding them here directly. 12 | # See /usr/share/doc/bash-doc/examples in the bash-doc package. 13 | 14 | if [ -f ~/.bash_aliases ]; then 15 | . ~/.bash_aliases 16 | fi 17 | 18 | # enable programmable completion features (you don't need to enable 19 | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile 20 | # sources /etc/bash.bashrc). 21 | if [ -f /etc/bash_completion ] && ! shopt -oq posix; then 22 | . /etc/bash_completion 23 | fi 24 | 25 | alias console="php bin/console" 26 | alias s.database.drop="php bin/console doctrine:database:drop" 27 | alias s.database.create="php bin/console doctrine:database:create" 28 | alias s.database.diff="php bin/console doctrine:migrations:diff" 29 | alias s.database.migrate="php bin/console doctrine:migrations:migrate" 30 | alias s.database.fixtures.load="php bin/console doctrine:fixtures:load" 31 | alias s.routes="php bin/console debug:router" 32 | alias s.container="php bin/console debug:container" 33 | alias s.config="php bin/console config:dump-reference" 34 | alias s.terminal="source /root/.bashrc" 35 | alias s.cache.clear="php bin/console cache:clear --no-warmup --env=dev;php bin/console cache:clear --no-warmup --env=prod" 36 | alias s.translation.update="php bin/console translation:update --dump-messages --force" 37 | 38 | 39 | -------------------------------------------------------------------------------- /build/php7-fpm/utils/id_rsa: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAq0hrEKWVRoHGiz+3ZHVd1JZmOQXZHCCB/O9ea6AatH4m5tJF 3 | w3WKQVmWc7MnUAEtYxoVEd0xc9mcTwNVT9xn36E0ZtlZyZhShssRvKV7Reb6k2cX 4 | xoMOqmCOuDME7yYYhZPcQHXkVIU2O5Z+gPV/Tn/Z7yDgohNwXoidCM03DQC+CFcn 5 | xE/m8N05wvSbDPE0OihLcGtfv+X8EsmBu0Qm3QOu66iZafU9TvoXoYRkr/2N4amU 6 | TBsXAsB2mjevnN7i8BcGq2bgXy0wfwgdODMAJnHBCzcJQOeUppvhBEF+QPexBKhp 7 | W85XQ2pgmbeg/1R/sZRL57IVG9Ul2wbN1aiJRQIDAQABAoIBAQCogoqyyfTedPa8 8 | MGdgsgcqCv1uxE4g2eqIyYZ/I/ih8iqbk+uGrLDkMhtOoMbgcwgQI6zu8kqgy0p4 9 | gbMA6rpWzOYc+WDYcL9gVZCRo8xvrRqAwkAl0PIwtOY0Wh1UmootgJaD5HhKnvQI 10 | E7tJbD1fIXFrTVEyoyU+G/FCo4KxiphpWCQtgPP+YhznaaVfjZD5wLPxES2klYnZ 11 | ggeABG+/STQhX8zT1jrAsz0S3BmV4YBKnCB+3PYXh/qaURQsvFJ7dojQBZoEaMx8 12 | TY7tclcm14EmZIytXuQpfjuwHe1qLQ1mjDB8fFs6zl78Q01QP7xgpczHsgA8+pHp 13 | iwPW56eBAoGBAOBYjhiEibQWndO1nQvE5LedbvkyCFFJ3SIs6og5xQQzZWHsmyfz 14 | ePDZZ+m+d6gtuBfywV97fdVSAWxhAgZ+JgwKv9jlBo9Wnc+h+4VbQvub9QJSjRcH 15 | a8R7onP8jPkqhFIHwxcrOIgKBcZebsXNP0vxrRAjTRsshPeLgcrcurUNAoGBAMNz 16 | Na+BsgXQbJ3/d479pXmMuWTZqNzKm9wsPnv3pGUtTp+qyJYmwyMvvxH9cNaMGxhX 17 | Q+Vco5b1UOQAp89G5rWbuVf2gS8V/CZZqoqjK454a0Zkh+Ic2a9SlxCShbGq77pT 18 | fkyUr3Gmx+++utWPMbEWf51Ktlr2FWgOguji/4cZAoGAekbJ7AMRKt7I1wM9vZRr 19 | NMjSG3BxqByiMmZYzjbucwOwVlcnmfbSDDPytyvg/AEvPZ5KV0hvpT01GWUmPXO0 20 | OQwC1Ky/jpCfIvQequi68XhnagSkcdDRpB3exWj5TTUnOa6RXqdoAH21+BCwP49G 21 | 2JW4xfr3o7/4GRQogfEcsmECgYAp86m7UThX/SPDShlsjM8e5vDIT9vqAGcx/CEx 22 | VLdprC7rIKpLaGiMPexiPSciNhJ+yARfz+GhPmitd+KNICfXJWTEF7ok1DA6PxbX 23 | CS0JOJm2E1ADXbPv6OdZ/ElMGGe6c79xSpzZ5TWXJTZPLpw46Z5csbOwlI+FtU+u 24 | E0NLyQKBgFxUbD5Int9p466s4PYtY+p7K1lbvcXRGpTeEhOPPpx9SPj05g7bzXRL 25 | aYoxPJ99sbA4d0odZHM3t/6P854Cxy4jdw/d9uYMmBg7C0PHoJNAvXjcmKTSnlnv 26 | pKtqMiX/1oYaIV741ishxg3JP+tbY94hib7CsO0r0JIu0aiGiH7u 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /build/php7-fpm/utils/id_rsa.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrSGsQpZVGgcaLP7dkdV3UlmY5BdkcIIH8715roBq0fibm0kXDdYpBWZZzsydQAS1jGhUR3TFz2ZxPA1VP3GffoTRm2VnJmFKGyxG8pXtF5vqTZxfGgw6qYI64MwTvJhiFk9xAdeRUhTY7ln6A9X9Of9nvIOCiE3BeiJ0IzTcNAL4IVyfET+bw3TnC9JsM8TQ6KEtwa1+/5fwSyYG7RCbdA67rqJlp9T1O+hehhGSv/Y3hqZRMGxcCwHaaN6+c3uLwFwarZuBfLTB/CB04MwAmccELNwlA55Smm+EEQX5A97EEqGlbzldDamCZt6D/VH+xlEvnshUb1SXbBs3VqIlF root@1fb9937bf0b2 2 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | db: 5 | image: mysql 6 | volumes: 7 | - "./.data/var/lib/mysql:/var/lib/mysql" 8 | environment: 9 | MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} 10 | MYSQL_DATABASE: ${MYSQL_DATABASE} 11 | MYSQL_USER: ${MYSQL_USER} 12 | MYSQL_PASSWORD: ${MYSQL_PASSWORD} 13 | networks: 14 | network_bridge: 15 | ipv4_address: 172.18.0.4 16 | php: 17 | build: 18 | context: build/php7-fpm 19 | args: 20 | TIMEZONE: ${TIMEZONE} 21 | ports: 22 | - "9000:9000" 23 | # To add a web project, follow these four steps: 24 | # 1. Add project folders to volume here. 25 | # 2. Create a .conf file at Docker/nginx folder. 26 | # 3. ADD this .conf file to Docker/nginx/Dockerfile and RUN it in another line. 27 | # 4. Add new domain to host machine's etc/hosts file pointing to 127.0.0.1 28 | volumes: 29 | - ./build/php7-fpm/cfg/custom.ini:/usr/local/etc/php/conf.d/custom.ini:cached 30 | - ${SYMFONY_APP_PATH}:/var/www/symfony:rw 31 | - /Users/yahyaerturan/Code/ClinicManagement:/var/www/ClinicManagement:rw 32 | - /Users/yahyaerturan/Code/clinicSMF4:/var/www/clinicSMF4:rw 33 | - /Users/yahyaerturan/Code/symfony4tutorial:/var/www/symfony4tutorial:rw 34 | - /Users/yahyaerturan/CodeOut/doktor-bul:/var/www/doktor-bul:rw 35 | - /Users/yahyaerturan/Code/cpanel_api:/var/www/cpanel_api:cached 36 | - ./.data/var/log/symfony:/var/www/symfony/var/log:rw 37 | networks: 38 | network_bridge: 39 | ipv4_address: 172.18.0.3 40 | nginx: 41 | build: build/nginx 42 | ports: 43 | - 80:80 44 | volumes_from: 45 | - php 46 | volumes: 47 | - ./.data/var/log/nginx/:/var/log/nginx:cached 48 | networks: 49 | network_bridge: 50 | ipv4_address: 172.18.0.2 51 | elk: 52 | image: willdurand/elk 53 | ports: 54 | - 81:80 55 | volumes: 56 | - ./build/elk/logstash:/etc/logstash:cached 57 | - ./build/elk/logstash/patterns:/opt/logstash/patterns:cached 58 | volumes_from: 59 | - php 60 | - nginx 61 | networks: 62 | network_bridge: 63 | ipv4_address: 172.18.0.5 64 | phpmyadmin: 65 | image: phpmyadmin/phpmyadmin 66 | ports: 67 | - "8080:80" 68 | networks: 69 | network_bridge: 70 | ipv4_address: 172.18.0.6 71 | 72 | networks: 73 | network_bridge: 74 | driver: bridge 75 | driver_opts: 76 | com.docker.network.enable_ipv6: "false" 77 | ipam: 78 | driver: default 79 | config: 80 | - subnet: 172.18.0.0/24 81 | gateway: 172.18.0.1 82 | --------------------------------------------------------------------------------