/cakephp-docker

Docker compose for CakePHP applications

Primary LanguageDockerfile

Setup CakePHP using docker

  1. Copy Dockerfile and docker-compose.yml files to your project root directory.

  2. Make sure you update the database in config/app.php and MYSQL_DATABASE in docker-compose.yml.

  3. Build the image of the container

    docker-compose build
  4. Start the service

    docker-compose up
  5. Stop the service

    docker-compose down

You can run below command inside the container

  1. Install the composer

    docker-compose run cakephp composer install --no-interaction
  2. Migration

    docker-compose run cakephp bin/cake migrations migrate
  3. Stop service with volume

    docker-compose down -v

Run same project with multiple php versions

  1. Copy the project folder

  2. Update the base image in docker file.

  3. Follow the "Setup CakePHP using docker" steps.