Skip to content

Commit 5d6206a

Browse files
authored
Merge pull request #6 from vfalies/2.3-rc
2.3
2 parents 632d31a + ff112d6 commit 5d6206a

31 files changed

+639
-340
lines changed

.env.dist

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
MAILDEV_PORT=1080
22
DBADMIN_PORT=9090
3+
DBADMIN_VERSION=4.8
34
WEB_PORT=80
45
WEBSSL_PORT=443
5-
PHP_VERSION=7.2-fpm-alpine
6+
PHP_VERSION=7.2-fpm
67
DB=mysql
8+
DB_VERSION=5.7
79
WEB_SERVER=nginx
10+
WEB_SERVER_VERSION=1.15-alpine
811
PROJECTS_PATH=/your/projects/directory/path
12+
PROJECTS_PATH_DEST=/var/www/html/projects
913
MYSQL_ROOT_PASSWORD=root
1014
CACHE_SERVER=redis
11-
CACHE_PORT=6380
15+
CACHE_VERSION=4.0-alpine
16+
CACHE_PORT=6380
17+
CONTAINER_DB_NAME=db

CHANGELOG.md

+27
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [2.3] - 2018-07-14
9+
10+
### Changed
11+
12+
- Change default version of PHP in `.env.dist` file from 7.2 FPM alpine to 7.2 FPM
13+
- Change License date
14+
- Update README
15+
- Move PHP FileMatch from Apache VHost configuration to generic Apache configuration
16+
- Refactoring documentation in multiple files
17+
18+
### Added
19+
20+
- Add JS Tools : NodeJS, Npm, Grunt, Gulp, Yarn
21+
- Add Bash in alpine versions
22+
- Add PHP wrapper
23+
- Add Node wrapper
24+
- Add Git wrapper
25+
- Add Composer wrapper
26+
- Add Grunt wrapper
27+
- Add Gulp wrapper
28+
- Add Npm wrapper
29+
- Add Yarn wrapper
30+
- Add Typescript wrapper
31+
- Create a docker `vfac` network
32+
- Fix image versions from `.env` configuration file (Database, Web server, Cache server, Database admin)
33+
- Add customization of projects path in container from `.env` file
34+
835
## [2.2.1] - 2018-06-19
936

1037
### Added

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016-2017 Vincent Faliès
3+
Copyright (c) 2016-2018 Vincent Faliès
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ homepage: ## Launch EnvDev homepage in default browser
3636
@echo '******** Launch Homepage in browser ********'
3737
@x-www-browser envdev.localhost
3838

39-
terminal: ## Create a terminal to php container
39+
terminal: ## Create a terminal
4040
@echo '******** Launch terminal ********'
4141
@docker exec -ti php /bin/bash
4242

43-
terminalroot: ## Create a terminal to php container as root
43+
terminalroot: ## Create a terminal as root
4444
@echo '******** Launch terminal as root ********'
4545
@docker exec -ti -u 0 php /bin/bash

README.md

+5-295
Original file line numberDiff line numberDiff line change
@@ -2,110 +2,7 @@
22

33
## Environment composition
44

5-
This environment provies the following tools to develop in PHP :
6-
7-
### Core
8-
9-
- [PHP](http://php.net)
10-
11-
Available version :
12-
13-
- `7.0`
14-
- `7.1`
15-
- `7.2`
16-
17-
The version is configured in `.env` file. Default: `7.2`
18-
PHP Stack run on Alpine version to keep a small size image.
19-
20-
- Database
21-
22-
Two different database are available :
23-
24-
- [MySQL](https://www.mysql.com)
25-
- [MongoDB](https://www.mongodb.com)
26-
27-
The database wished is configured in `.env` file. Default: `mysql`
28-
29-
- Web server
30-
31-
Two web server are available :
32-
33-
- [Nginx](https://nginx.org)
34-
- [Apache](https://httpd.apache.org/)
35-
36-
All of them are in Alpine version.
37-
38-
- Cache server
39-
40-
Two cache server are available :
41-
42-
- [Redis](https://redis.io/)
43-
- [Memcached](https://memcached.org/)
44-
45-
All of them are in Alpine version
46-
47-
### Tools
48-
49-
#### Database admin
50-
51-
- [MongoExpress](https://github.com/mongo-express/mongo-express) : Manage Mongo database instances
52-
- [PHPMyAdmin](https://www.phpmyadmin.net/) : Manage Mongo database instances
53-
54-
#### Mail hub
55-
56-
- [MailDev](http://danfarrelly.nyc/MailDev) : SMTP Server + Web Interface for viewing and testing emails during development
57-
58-
#### Composer
59-
60-
- [Composer](https://getcomposer.org) : Dependency Manager for PHP
61-
62-
#### NodeJs
63-
64-
- [NodeJs](https://nodejs.org/en) : JavaScript runtime
65-
66-
#### Makefile
67-
68-
A `Makefile` is available in command line to manage several actions.
69-
70-
Type following command to display help :
71-
72-
```shell
73-
make
74-
```
75-
76-
or
77-
78-
```shell
79-
make help
80-
```
81-
82-
Output:
83-
84-
```shell
85-
help: Show this help
86-
servers: Start all containers
87-
start: Start all containers
88-
stop: Stop all containers
89-
restart: Restart all containers
90-
certificate: Generate a SSL certificate
91-
renewal: Renewal a knowed SSL certificate
92-
install: Install EnvDev container environment
93-
homepage: Launch EnvDev homepage in default browser
94-
terminal: Create a terminal to php container
95-
terminalroot: Create a terminal to php container as root
96-
```
97-
98-
### Optional tools
99-
100-
Optional tools are available to use in EnvDev. They are not included by default but can be added easily.
101-
102-
- [APIGen](https://github.com/ApiGen/ApiGen) : Documentation for your PHP project
103-
104-
Image container : [`vfac/apigen`](https://hub.docker.com/r/vfac/apigen/)
105-
106-
- [Deployer](https://deployer.org) : Deployment tool for PHP
107-
108-
Image container : [`vfac/deployer`](https://hub.docker.com/r/vfac/deployer/)
5+
This environment provies the following tools to develop in PHP / JS :
1096

1107
## Requirements
1118

@@ -129,200 +26,13 @@ To install environment
12926
make install
13027
```
13128

132-
## Usage
133-
134-
To start the environment, type the following command:
135-
136-
```shell
137-
make servers
138-
```
139-
140-
or
141-
142-
```shell
143-
make start
144-
```
145-
146-
Several containers are created from `.env` configuration:
147-
148-
| Description | Container's name |
149-
|-------------|------------------|
150-
| Maildev hub mail | `maildev` |
151-
| NodeJs | `nodejs` |
152-
| Web server ( Apache or Nginx ) | `web` |
153-
| PHP container | `php` |
154-
| Cache server | `cache` |
155-
| Database server | `db` |
156-
| Database admin tool | `dbadmin` |
157-
158-
`composer` is available through `php` container:
159-
160-
```shell
161-
docker exec php composer -v
162-
```
163-
164-
`node`, `npm` are available through `node` container:
165-
166-
```shell
167-
docker run --rm node node -v
168-
```
169-
170-
```shell
171-
docker run --rm node npm -v
172-
```
173-
174-
To open default home page in browser
175-
176-
```shell
177-
make homepage
178-
```
179-
180-
### Hosts
181-
182-
You can add your own hosts file for all your projects.
183-
184-
With NGinx
185-
186-
In `conf/nginx/vhosts` directory, all your `yourhost.conf` file. A default host file is available for example : `/conf/nginx/vhosts/default.conf`.
187-
188-
```conf
189-
server {
190-
191-
listen 80;
192-
server_name localhost;
193-
root /var/www/html;
194-
index index.php index.html index.htm;
195-
196-
location ~* \.PHP$ {
197-
fastcgi_index index.php;
198-
fastcgi_pass php:9000;
199-
include fastcgi_params;
200-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
201-
}
202-
203-
}
204-
```
205-
206-
With Apache
207-
208-
In `conf/apache/vhosts` directory, all your `yourhost.conf` file. A default host file is available for example : `/conf/apache/vhosts/default.conf`.
209-
210-
```conf
211-
<VirtualHost *:80>
212-
ServerName localhost
213-
DocumentRoot /var/www/html/projects
214-
215-
<Directory /var/www/html/projects>
216-
Require all granted
217-
</Directory>
218-
219-
<FilesMatch \.php$>
220-
SetHandler "proxy:fcgi://php:9000"
221-
</FilesMatch>
222-
</VirtualHost>
223-
```
224-
225-
### SSL support
226-
227-
The SSL support is possible during development. To activate it on one of your vhosts, you must follow steps:
228-
229-
- Create the SSL self-signed certificate
230-
231-
you can use the command:
232-
233-
```shell
234-
make certificate
235-
```
236-
237-
- Add the activation of SSL in VHost file
238-
239-
On Nginx:
240-
241-
```
242-
listen 443 ssl;
243-
244-
ssl_certificate /etc/nginx/ssl/envdev.crt;
245-
ssl_certificate_key /etc/nginx/ssl/envdev.key;
246-
```
247-
248-
On Apache:
249-
250-
```
251-
<VirtualHost *:80 *:443>
252-
...
253-
254-
SSLEngine on
255-
SSLCertificateFile /usr/local/apache2/conf/custom/envdev.crt
256-
SSLCertificateKeyFile /usr/local/apache2/conf/custom/envdev.key
257-
258-
...
259-
```
260-
261-
where `envdev` is the name chosen during the step of the certificate creation.
262-
263-
Don't forget to restart `web` container to restart the web server
264-
265-
```shell
266-
docker restart web
267-
```
268-
269-
Tips: If you certificate is out of date, you can renew it with the command:
270-
271-
```shell
272-
make renewal
273-
```
274-
275-
## Configuration
276-
277-
You can create `.env` file to manage applications and tools.
278-
An example is available with `.env.dist` file.
279-
280-
The following versions, paths and ports can be configured :
281-
282-
| Description | Variable name | Possible values | Default |
283-
|:-------------|:---------------:|:-----------------:|:---------:|
284-
| PHP Version | PHP_VERSION | `7.0-fpm`, `7.1-fpm`, `7.2-fpm`, `7.0-cli`, `7.1-cli`, `7.2-cli`, `7.0-fpm-alpine`, `7.1-fpm-alpine`, `7.2-fpm-alpine`, `7.0-cli-alpine`, `7.1-cli-alpine`, `7.2-cli-alpine` | `7.2-fpm-alpine` |
285-
| Web Server type | WEB_SERVER | `nginx`, `apache` | `nginx` |
286-
| Database type | DB | `mariadb`, `mysql`, `mongodb` | `mysql` |
287-
| Cache server type | CACHE_SERVER | `redis`, `memcached` | `redis` |
288-
| Projects Path | PROJECTS_PATH | any | `/your/projects/directory/path` |
289-
| HTTP web port | WEB_PORT | any | `80` |
290-
| HTTPS web port | WEBSSL_PORT | any | `443` |
291-
| MailDev port | MAILDEV_PORT | any | `1080` |
292-
| PHPMyAdmin port | PHPMYADMIN_PORT | any | `9090` |
293-
| MongoExpress port | MONGOEXPRESS_PORT | any | `8081` |
294-
| Cache server port | CACHE_PORT | any | `6380` |
295-
296-
If you access to the url `http://envdev.localhost` a page summarizes all projets and propose access link to PHPMyAdmin, MailDev and PHPInfo.
297-
298-
### Nginx configuration
299-
300-
Nginx configuration file is available at `/conf/nginx/nginx.conf` to custom the web server configuration.
301-
302-
### Apache configuration
303-
304-
Apache configuration file is available at `/conf/apache/httpd.conf` to custom the web server configuration.
305-
306-
### PHP configuration
307-
308-
A custom php.ini file is available at `/conf/php/php.ini`. The default PHP configuration is with these options:
309-
310-
```conf
311-
date.timezone = Europe/Paris
312-
display_errors=1
313-
error_reporting=E_ALL
314-
log_errors = on
315-
error_log = /var/log/php_errors.log
316-
memory_limit = 256M
317-
upload_max_filesize = 200M
318-
post_max_size = 40M
319-
```
29+
## Documentation
32030

321-
### Projects configuration
31+
All documentation is available in [docs directory](./docs)
32232

323-
To simplify projects source sharing between containers, you can install source projects in the path define in `.env` with variable `PROJECTS_PATH`.
33+
## Troubleshooting
32434

325-
Naturally, you can change the default path. In this case, the default summary will not be available.
35+
2.3 version of EnvDev, has add new environment constants in `.env` file. If you use an older version, this file must be update with all constants presents in `.env.dist`.
32636

32737
## Open source
32838

0 commit comments

Comments
 (0)