This repository is part of The Easiest Way to Dockerize a PHP Application post.
Two apps are awesome and best.
Every app has a docker directory and .env and docker-compose.yml files.
Awesome app is a simple app and Best app is a more complex app with almost every docker-compose.yml line explained.
https://github.com/v-m-i/simple-php-app-dockerization/blob/main/apps/best/docker/docker-compose.yml
https://github.com/v-m-i/simple-php-app-dockerization/blob/main/apps/best/docker/.env
- When dockerizing a real-life app, you will probably want to add a
.htaccessfile in your Apache document root, but as.htaccessis unique per project, we won't cover setting that up. - This project might work slower on Mac, see Docker on Mac - how to speed it up? for tips on how to improve performance.
Proxy has its certificates directory and .env and docker-compose.yml files.
https://github.com/v-m-i/simple-php-app-dockerization/blob/main/proxy/docker-compose.yml
https://github.com/v-m-i/simple-php-app-dockerization/blob/main/proxy/.env
- Add
127.0.0.1 www.best.com app.best.com www.awesome.comto your hosts; - Run
./start.sh(Ports 80 and 443 must be free); - Visit www.best.com or app.best.com or www.awesome.com;
- To stop, run
./stop.sh.
Debugger is enabled only for the best app.
If you are using PhpStorm, see Zero-configuration debugging.
After listening is started in PhpStorm, go to apps/best/docker and run docker-compose exec app php -d xdebug.start_with_request=yes public/index.php.
When asked, set up server configuration like this:

