1+ # EnvDev
2+
13## Environment composition
24
35This environment provies the following tools to develop in PHP :
46
57### Core
8+
69- [ PHP] ( http://php.net )
710
811Available version :
@@ -17,7 +20,7 @@ PHP Stack run on Alpine version to keep a small size image.
1720
1821- Database
1922
20- Two different database are available :
23+ Two different database are available :
2124
2225 - [MySQL](https://www.mysql.com)
2326 - [MongoDB](https://www.mongodb.com)
@@ -53,7 +56,7 @@ All of them are in Alpine version
5356
5457- [ MailDev] ( http://danfarrelly.nyc/MailDev ) : SMTP Server + Web Interface for viewing and testing emails during development
5558
56- #### Composer
59+ #### Composer
5760
5861- [ Composer] ( https://getcomposer.org ) : Dependency Manager for PHP
5962
@@ -76,21 +79,31 @@ Image container : [`vfac/deployer`](https://hub.docker.com/r/vfac/deployer/)
7679## Requirements
7780
7881Two system dependencies are required :
82+
7983- Docker
8084- Docker Compose
8185
8286## Installation
8387
88+ ``` shell
89+ git clone
[email protected] :vfalies/EnvDev.git
8490```
85- $ git clone [email protected] :vfalies/EnvDev.git 91+
92+ Create a ` .env ` file to define your configuration.
93+ An example is available with ` .env.dist ` file.
94+
95+ To install environment
96+
97+ ``` shell
98+ make install
8699```
87100
88101## Usage
89102
90103To start the environment, type the following command:
91104
92- ```
93- $ docker-compose up
105+ ``` shell
106+ make servers
94107```
95108
96109Several containers are created from ` .env ` configuration:
@@ -107,29 +120,35 @@ Several containers are created from `.env` configuration:
107120
108121` composer ` is available through ` php ` container:
109122
110- ```
123+ ``` shell
111124docker exec php composer -v
112125```
113126
114127` node ` , ` npm ` are available through ` node ` container:
115128
116- ```
129+ ``` shell
117130docker run --rm node node -v
118131```
119132
120- ```
133+ ``` shell
121134docker run --rm node npm -v
122135```
123136
137+ To open default home page in browser
138+
139+ ``` shell
140+ make home
141+ ```
142+
124143### Hosts
125144
126- You can add your own hosts file for all your projects.
145+ You can add your own hosts file for all your projects.
127146
128- With NGinx
147+ With NGinx
129148
130149In ` conf/nginx/vhosts ` directory, all your ` yourhost.conf ` file. A default host file is available for example : ` /conf/nginx/vhosts/default.conf ` .
131150
132- ```
151+ ``` conf
133152server {
134153
135154 listen 80;
@@ -151,39 +170,41 @@ With Apache
151170
152171In ` conf/apache/vhosts ` directory, all your ` yourhost.conf ` file. A default host file is available for example : ` /conf/apache/vhosts/default.conf ` .
153172
154- ```
173+ ``` conf
155174<VirtualHost *:80>
156175 ServerName localhost
157- DocumentRoot /var/www/html
176+ DocumentRoot /var/www/html/projects
158177
159- <Directory /var/www/html>
178+ <Directory /var/www/html/projects >
160179 Require all granted
161180 </Directory>
162181
163182 <FilesMatch \.php$>
164- SetHandler "proxy:fcgi://php:9000"
183+ SetHandler "proxy:fcgi://php:9000"
165184 </FilesMatch>
166185</VirtualHost>
167186```
168187
169188## Configuration
170189
171- You can modify ` .env ` file to manage applications and tools.
190+ You can create ` .env ` file to manage applications and tools.
191+ An example is available with ` .env.dist ` file.
192+
172193The following versions, paths and ports can be configured :
173194
174195| Description | Variable name | Possible values | Default |
175196| :-------------| :---------------:| :-----------------:| :---------:|
176197| PHP Version | PHP_VERSION | ` 5.6 ` , ` 7.0 ` , ` 7.1 ` , ` 7.2 ` | ` 7.2 ` |
177198| Database type | DB | ` mariadb ` , ` mysql ` , ` mongodb ` | ` mysql ` |
178199| Cache server type | CACHE_SERVER | ` redis ` , ` memcached ` | ` redis ` |
179- | Projects Path | PROJECTS_PATH | any | ` ./ projects` |
200+ | Projects Path | PROJECTS_PATH | any | ` /your/ projects/directory/path ` |
180201| HTTP web port | WEB_PORT | any | ` 80 ` |
181202| MailDev port | MAILDEV_PORT | any | ` 1080 ` |
182203| PHPMyAdmin port | PHPMYADMIN_PORT | any | ` 9090 ` |
183204| MongoExpress port | MONGOEXPRESS_PORT | any | ` 8081 ` |
184205| Cache server port | CACHE_PORT | any | ` 6380 ` |
185206
186- If you access to the url ` http://localhost ` a page summarizes all projets and propose access link to PHPMyAdmin, MailDev and PHPInfo.
207+ If you access to the url ` http://envdev. localhost ` a page summarizes all projets and propose access link to PHPMyAdmin, MailDev and PHPInfo.
187208
188209### Nginx configuration
189210
@@ -195,9 +216,9 @@ Apache configuration file is available at `/conf/apache/httpd.conf` to custom th
195216
196217### PHP configuration
197218
198- A custom php.ini file is available at ` /conf/php/php.ini ` . The default PHP configuration is with these options:
219+ A custom php.ini file is available at ` /conf/php/php.ini ` . The default PHP configuration is with these options:
199220
200- ```
221+ ``` conf
201222date.timezone = Europe/Paris
202223display_errors=1
203224error_reporting=E_ALL
0 commit comments