Giter Site home page Giter Site logo

docker-laravel5's Introduction

docker-laravel5

Description

Build Laravel's development environment using docker. PHP7.3/MySQL8.0/nginx/composer/redis/node

Usage

Git clone

$ git clone [email protected]:ucan-lab/docker-laravel5.git
$ cd docker-laravel5

Docker compose build & up

$ docker-compose up -d --build

Install Laravel 5 using Composer

$ docker-compose exec app composer create-project --prefer-dist "laravel/laravel=5.8.*" .
$ docker-compose exec app composer require predis/predis

http://127.0.0.1:10080

or

http://localhost:10080

or

curl -s http://localhost:10080/ -o /dev/null -w '%{http_code}\n'

Running Migrations

$ docker-compose exec app php artisan migrate

Running Testings

$ docker-compose exec app ash -l
$ cp .env.example .env.testing
$ php artisan key:generate --env testing
$ sed -i -e 's/<php>/<php>\n        <env name="DB_HOST" value="db-testing" force="true"\/>/' phpunit.xml
$ ./vendor/bin/phpunit

Send Test Mail

$ docker-compose exec app php artisan tinker
Mail::raw('test mail',function($message){$message->to('[email protected]')->subject('test');});

http://127.0.0.1:18025

As necessary

Composer dump autoload

$ docker-compose exec app composer dump-autoload

MySQL connection

$ docker-compose exec db bash -c 'mysql -uroot -p${MYSQL_PASSWORD} ${MYSQL_DATABASE}'

Node(npm)

$ docker-compose run node npm install
$ docker-compose run node npm run dev

Node(yarn)

$ docker-compose run node yarn install
$ docker-compose run node yarn run dev

Redis for Laravel

$ docker-compose exec app php artisan tinker
Redis::set('name', 'hoge');
Redis::get('name');

Redis cli

$ docker-compose exec redis redis-cli

Clear database volume

$ docker-compose down --volumes --rmi all
$ docker-compose up -d --build
$ docker-compose exec app php artisan migrate

Clone of exists code

$ git clone [email protected]:ucan-lab/docker-laravel5.git
$ cd docker-laravel5
$ docker-compose up -d --build

$ git clone <source code url>
$ docker-compose exec app composer install
$ docker-compose exec app ash -l
$ cp .env.example .env
$ php artisan key:generate
$ php artisan migrate:fresh

docker-laravel5's People

Contributors

chobitsky avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.