A set of preconfigured Docker servers made to work with your Yii2 advanced application framework or other PHP frameworks.
It includes:
- A webserver (PHP7.1, Apache2.4, composer, xdebug)
- A Database server (Mysql 5.5)
- A Redis server
- A shared folder between servers
- install docker
- open
docker-compose.yml
and fillGITHUB_API_TOKEN
,MYSQL_DATABASE
,MYSQL_USER
,MYSQL_PASSWORD
with your own data - launch your server by
docker-composer up
(add-d
to run it in the background) - copy / pull your yii2 application (o create a new one) inside
application
folder - launch the init script by entering in the web-server bash (see above)
- access your website by browser here http://172.17.0.3
- access your webserver console by running
docker exec -it DKP_Web_Server bash
- access your database console by running
docker exec -it DKP_Database_Server bash
- access your redis console by running
docker exec -it DKP_Redis_Server bash
The docker-data
folder contains a folder for each server. You can find some configuration files inside it:
- Apache2 virtualhosts:
./docker-data/web-server/etc/apache2/sites/available/000-default.config
- MySql configuration:
./docker-data/db-server/etc/mysql/my.cnf
The database connection is set on IP address 172.17.0.2, port 3306. The credentials are setted in docker-compose.yml
Since I prefer MySql Workbench to PhpMyAdmin, I haven't included it in the configuration.
You can include it by follow the instructions explained here, or by download a Mysql desktop client like MySql Workbenck.
Any file in ./docker-data/shared-folder/
will be visible in the /root/backup/
folder of each instanced server.