For CakePHP version 3.x using Ubuntu 18.04 as base image.
Stack
- Nginx
- PHP 7.2
- CakePHP vesion 3.x
Loaded PHP Extensions
- Mysql
- Intl
- Mbstring
- Zip
- Xml
- Sqlite3
docker build -t cakephp3-image -f Dockerfile.dev .
docker run -p 8080:80 -dit --name conainer_name-web --mount type=bind,source="$(pwd)",target=/var/www/html cakephp3-image
docker exec -it conainer_name-web bash
- You can start by create a CakePHP project vversion 3.x via composer
composer create-project --prefer-dist cakephp/app:^3.9 <project_name>
-
Build the dockerfile configuration and create a container for it.
-
Now that you have your container setup, let us setup CakePHP
docker exec -it <project_name> bash
# let us complete the CakePHP installation
php composer.phar install
This document assumes that you have composer.phar file.
-
You should be able to load your web-application from your browser with the port you incidated above. Example: http://localhost:8080
-
Update your app-config file so that you can connect to your database