Build Laravel's development environment using docker.
PHP7.3/MySQL8.0/nginx/composer/redis/node
$ git config --global core.autocrlf false
$ git clone [email protected]:ucan-lab/docker-laravel5.git
$ cd docker-laravel5
$ docker-compose up -d
$ docker-compose run composer create-project --prefer-dist "laravel/laravel=5.8.*" .
$ docker-compose exec app ash -l
$ sed -i -e "s/DB_HOST=.*/DB_HOST=db/" .env
$ php artisan migrate
$ docker-compose exec app ash -l
$ cp .env.example .env.testing
$ php artisan key:generate --env testing
$ sed -i -e "s/DB_HOST=.*/DB_HOST=db-testing/" .env.testing
$ ./vendor/bin/phpunit
$ docker-compose exec app ash -l
$ sed -i -e "s/MAIL_HOST=.*/MAIL_HOST=mail/" .env
$ sed -i -e "s/MAIL_PORT=.*/MAIL_PORT=1025/" .env
$ php artisan tinker
Mail::raw('test mail',function($message){$message->to('[email protected]')->subject('test');});
$ docker-compose run composer dump-autoload
$ docker-compose exec db bash
$ mysql -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE}
$ docker-compose run node npm install
$ docker-compose run node npm run dev
$ docker-compose run node yarn install
$ docker-compose run node yarn run dev
$ docker-compose exec app ash -l
$ composer require predis/predis
$ sed -i -e 's/REDIS_HOST=.*/REDIS_HOST=redis/' .env
$ sed -i -e 's/CACHE_DRIVER=.*/CACHE_DRIVER=redis/' .env
$ sed -i -e 's/SESSION_DRIVER=.*/SESSION_DRIVER=redis/' .env
$ php artisan tinker
Redis::set('name', 'hoge');
Redis::get('name');
$ docker-compose exec redis ash -l
$ redis-cli
$ docker volume ls
local ${COMPOSE_PROJECT_NAME}_db-data
$ docker volume rm ${COMPOSE_PROJECT_NAME}_db-data
$ git clone [email protected]:ucan-lab/docker-laravel5.git
$ cd docker-laravel5
$ docker-compose up -d
$ git clone <source code url>
$ docker-compose run composer install
$ docker-compose exec app ash -l
$ cp .env.example .env
$ php artisan key:generate
$ sed -i -e "s/DB_HOST=.*/DB_HOST=db/" .env
$ php artisan migrate:fresh