Skip to content
cakephp docker development environment
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cakephp3/cakephp
docker
README.md

README.md

cakephp3.7

56077045-8b3d8d80-5e12-11e9-8f04-6ea41ec2ba54

tutorials

  • CakePHP3.7
  • PHP7.2
  • Nginx 1.15.5
  • Mysql 5.7

dev

First, please refer to 1 if you are starting for the first time. Please refer to 2 if you use it after the second time.

  • ① If you are starting for the first time
fork my repository
$ rm -rf cakephp3.7/cakephp3/cakephp/*
$ cd docker
$ docker-compose up -d
$ docker exec -it cake3-phpfpm sh
# cd /var/www/html/cakephp3

# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# php composer-setup.php
# php -r "unlink('composer-setup.php');"

# php composer.phar create-project --prefer-dist cakephp/app cakephp
# exit
$ mv cakephp cakephp33
$ mv cakephp33 ../
$ rm -rf cakephp 
$ mv cakephp33 cakephp
  • change database
$ cd cakephp3.7/cakephp3/cakephp/config
$ vim app.php

    'Datasources' => [
        'default' => [
            'className' => 'Cake\Database\Connection',
            'driver' => 'Cake\Database\Driver\Mysql',
            'persistent' => false,
            'host' => 'mysql',
            /*
             * CakePHP will use the default DB port based on the driver selected
             * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
             * the following line and set the port accordingly
             */
            //'port' => 'non_standard_port_number',
            'username' => 'root',
            'password' => 'test',
            'database' => 'my_app',

  • ② One that starts from the second time
fork my repository
$ cd docker
$ docker-compose up -d
  • accessl url

http://localhost:8080/

スクリーンショット 2019-04-15 20 49 03

You can’t perform that action at this time.