Easily create a CraftCMS development environment with Docker.
Modified the original source to work easily on Mac docker environment.
- Added bridge networks
- Mounted local volume for MYSQL container so it won't erase after docker-compose down and docker-compose up
- Original source is from bshelling
Settings remain agnostic after bootstrap completion (i.e. file & folder permissions, credentials, structure). Settings are set by default or customized. For successful operation, it's assumed Docker, Docker Compose and Composer applications are installed. The images bshelling/craftphpenv and mysql:5.7 are written to the docker-compose.yml.
CraftCMS
Docker
Docker Compose
Composer
Before commanding the script below, install & turn on Docker
Check for Composer installation
$ composer -v
Check Docker & Docker Compose installation
$ docker -v && docker-compose -v
To run application
$ ./craftStarter.sh
To run it on Mac terminal
$ sh ./craftStarter.sh
Install CraftCMS at http://localhost:8081/index.php?p=admin/install
Container Info | |
---|---|
Docker Containers: | craft_web & craft_db |
Site Port: | 8081 |
Database Port: | 3308 |
Database Settings | |
---|---|
Host: | craft_db:3306 |
Root Password: | adminpwd |
Username: | admin |
Password: | adminpwd |
Default Database: | craftdb |
Project Config Enabled | config/general.php |