1
+ # EnvDev
2
+
1
3
## Environment composition
2
4
3
5
This environment provies the following tools to develop in PHP :
4
6
5
7
### Core
8
+
6
9
- [ PHP] ( http://php.net )
7
10
8
11
Available version :
@@ -17,7 +20,7 @@ PHP Stack run on Alpine version to keep a small size image.
17
20
18
21
- Database
19
22
20
- Two different database are available :
23
+ Two different database are available :
21
24
22
25
- [MySQL](https://www.mysql.com)
23
26
- [MongoDB](https://www.mongodb.com)
@@ -53,7 +56,7 @@ All of them are in Alpine version
53
56
54
57
- [ MailDev] ( http://danfarrelly.nyc/MailDev ) : SMTP Server + Web Interface for viewing and testing emails during development
55
58
56
- #### Composer
59
+ #### Composer
57
60
58
61
- [ Composer] ( https://getcomposer.org ) : Dependency Manager for PHP
59
62
@@ -76,21 +79,31 @@ Image container : [`vfac/deployer`](https://hub.docker.com/r/vfac/deployer/)
76
79
## Requirements
77
80
78
81
Two system dependencies are required :
82
+
79
83
- Docker
80
84
- Docker Compose
81
85
82
86
## Installation
83
87
88
+ ``` shell
89
+ git clone git@github.com:vfalies/EnvDev.git
84
90
```
85
- $ git clone git@github.com: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
86
99
```
87
100
88
101
## Usage
89
102
90
103
To start the environment, type the following command:
91
104
92
- ```
93
- $ docker-compose up
105
+ ``` shell
106
+ make servers
94
107
```
95
108
96
109
Several containers are created from ` .env ` configuration:
@@ -107,29 +120,35 @@ Several containers are created from `.env` configuration:
107
120
108
121
` composer ` is available through ` php ` container:
109
122
110
- ```
123
+ ``` shell
111
124
docker exec php composer -v
112
125
```
113
126
114
127
` node ` , ` npm ` are available through ` node ` container:
115
128
116
- ```
129
+ ``` shell
117
130
docker run --rm node node -v
118
131
```
119
132
120
- ```
133
+ ``` shell
121
134
docker run --rm node npm -v
122
135
```
123
136
137
+ To open default home page in browser
138
+
139
+ ``` shell
140
+ make home
141
+ ```
142
+
124
143
### Hosts
125
144
126
- You can add your own hosts file for all your projects.
145
+ You can add your own hosts file for all your projects.
127
146
128
- With NGinx
147
+ With NGinx
129
148
130
149
In ` conf/nginx/vhosts ` directory, all your ` yourhost.conf ` file. A default host file is available for example : ` /conf/nginx/vhosts/default.conf ` .
131
150
132
- ```
151
+ ``` conf
133
152
server {
134
153
135
154
listen 80;
@@ -151,39 +170,41 @@ With Apache
151
170
152
171
In ` conf/apache/vhosts ` directory, all your ` yourhost.conf ` file. A default host file is available for example : ` /conf/apache/vhosts/default.conf ` .
153
172
154
- ```
173
+ ``` conf
155
174
<VirtualHost *:80>
156
175
ServerName localhost
157
- DocumentRoot /var/www/html
176
+ DocumentRoot /var/www/html/projects
158
177
159
- <Directory /var/www/html>
178
+ <Directory /var/www/html/projects >
160
179
Require all granted
161
180
</Directory>
162
181
163
182
<FilesMatch \.php$>
164
- SetHandler "proxy:fcgi://php:9000"
183
+ SetHandler "proxy:fcgi://php:9000"
165
184
</FilesMatch>
166
185
</VirtualHost>
167
186
```
168
187
169
188
## Configuration
170
189
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
+
172
193
The following versions, paths and ports can be configured :
173
194
174
195
| Description | Variable name | Possible values | Default |
175
196
| :-------------| :---------------:| :-----------------:| :---------:|
176
197
| PHP Version | PHP_VERSION | ` 5.6 ` , ` 7.0 ` , ` 7.1 ` , ` 7.2 ` | ` 7.2 ` |
177
198
| Database type | DB | ` mariadb ` , ` mysql ` , ` mongodb ` | ` mysql ` |
178
199
| 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 ` |
180
201
| HTTP web port | WEB_PORT | any | ` 80 ` |
181
202
| MailDev port | MAILDEV_PORT | any | ` 1080 ` |
182
203
| PHPMyAdmin port | PHPMYADMIN_PORT | any | ` 9090 ` |
183
204
| MongoExpress port | MONGOEXPRESS_PORT | any | ` 8081 ` |
184
205
| Cache server port | CACHE_PORT | any | ` 6380 ` |
185
206
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.
187
208
188
209
### Nginx configuration
189
210
@@ -195,9 +216,9 @@ Apache configuration file is available at `/conf/apache/httpd.conf` to custom th
195
216
196
217
### PHP configuration
197
218
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:
199
220
200
- ```
221
+ ``` conf
201
222
date.timezone = Europe/Paris
202
223
display_errors=1
203
224
error_reporting=E_ALL
0 commit comments