SlideShare a Scribd company logo
1 of 11
Download to read offline
Laradock を使って
気軽に Laravel を触ってみよう
2019/10/26 プロ生第60回 名古屋
ナーバ
目次
 この発表について
 自己紹介
 Laravel について
 Laradock について
 Laradock の超簡単使い方
 まとめ
2019/10/25 プロ生第60回 名古屋 2
この発表について
 LTなので細かい部分は端折ります
 仕事で Laravel は使っていますが、Laradock は使っていないので
そこまで詳しくはないです(言い訳)
 「こんなものあるんだー」ぐらいで聞いてください
2019/10/25 プロ生第60回 名古屋 3
自己紹介
 ナーバ(@Naba0123)
 2015年新卒、7ヶ月転職マン
 現在は某D社でバックエンドゲームエンジニア
 一時期リードエンジニア兼ディレクターとかやってた
 金沢在住
 プロ生第40回@金沢 主催
 今日は2年半ぶりぐらいの参加
2019/10/25 プロ生第60回 名古屋 4
Laravelについて
 PHPフレームワーク内での
GitHubスター数1位
 Googleトレンドで
ここ数年検索上昇中
 扱いに慣れるまでが大変
 付属機能が山盛り
 学習コストはちょい高め?
2019/10/25 プロ生第60回 名古屋 5
Laradock について
 Laradock is a full PHP development environment based on Docker.
 名前の通り Laravel の開発環境を Docker 上で簡単作っちゃおうぜのプロジェクト
 現在は Laravel のみならず、Symfony, WordPress などの開発も楽にできるようになってる
 中身としては docker-compose のファイルが入っている
 env ファイル があるので、好きにいじって、お好みのコンテナを起動させる
 あとは docker-compose がよしなに環境設定してくれて、いきなり開発開始!
2019/10/25 プロ生第60回 名古屋 6
Laradock の超簡単使い方
 これだけで nginx / mysql / phpMyAdmin / Redis / workspace のコンテナが起動
 実行する PHP プロジェクトは workspace に配置されるので、
対象PHP プロジェクトの .env 等に DB_HOST=mysql / REDIS_HOST=redis などを
記載しておけば、すぐに先程起動したmysqlコンテナの DB が使える
 コンテナ内は hosts がその名前(mysqlなど)で設定されているので、上記の設定でOK
$ git clone https://github.com/Laradock/laradock.git
$ cd laradock
$ cp env-example .env
$ docker-compose up –d nginx mysql phpmyadmin redis workspace
2019/10/25 プロ生第60回 名古屋 7
Laradock の超簡単使い方
 Laravel セットアップ
 workspace コンテナ内にコードを配置する
 .envで指定したパスが workspace 内コンテナと共有される
 workspace コンテナには、Laravel をインストールするための composer などがセットアップ済み
 一度コンテナ内で Laravel プロジェクトを作成して、そのパスを.envで指定するのが良さそう
 Laradock の .envファイルでアプリケーションパスを修正し、コンテナを再起動
2019/10/25 プロ生第60回 名古屋 8
$ docker exec -it laradock_workspace_1 /bin/bash
# composer create-project --prefer-dist laravel/laravel application
APP_CODE_PATH_HOST=../application
Laradock の超簡単使い方
 他にも・・・
 PHP のバージョンは複数から自由に選べる
 対応しているコンテナは数十種類もあるので、ぶっちゃけ PHP に限らずかなり使える
 Laravel には公式ツールの Homestead というもの(こちらは仮想サーバーを立ち上げる)
があるが、デプロイ等を考えると、コンテナでの開発の方が効率は良さそう?
 どこか不具合が起きたら、そのコンテナのみ作り直す、などもできるしね
2019/10/25 プロ生第60回 名古屋 9
まとめ
 とりあえず Laravel 触ってみたい人、
Webアプリケーションを作ってみたい人は、使ってみたら良いと思います!
 関係ないけど、WSL2 で docker が使えるようになるので、
ますます開発がしやすくなりますね!
 xdebug でのブレークポイント開発ももちろん可能
 詳しくはブログ記事をどうぞ
 Laradock + Laravel + VSCode + Xdebug 環境構築
https://blog.naba.biz/entry/2019/06/30/013349
2019/10/25 プロ生第60回 名古屋 10
おわり
2019/10/25 プロ生第60回 名古屋 11

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Laradock を使って 気軽に Laravel を触ってみよう

  • 1. Laradock を使って 気軽に Laravel を触ってみよう 2019/10/26 プロ生第60回 名古屋 ナーバ
  • 2. 目次  この発表について  自己紹介  Laravel について  Laradock について  Laradock の超簡単使い方  まとめ 2019/10/25 プロ生第60回 名古屋 2
  • 3. この発表について  LTなので細かい部分は端折ります  仕事で Laravel は使っていますが、Laradock は使っていないので そこまで詳しくはないです(言い訳)  「こんなものあるんだー」ぐらいで聞いてください 2019/10/25 プロ生第60回 名古屋 3
  • 4. 自己紹介  ナーバ(@Naba0123)  2015年新卒、7ヶ月転職マン  現在は某D社でバックエンドゲームエンジニア  一時期リードエンジニア兼ディレクターとかやってた  金沢在住  プロ生第40回@金沢 主催  今日は2年半ぶりぐらいの参加 2019/10/25 プロ生第60回 名古屋 4
  • 5. Laravelについて  PHPフレームワーク内での GitHubスター数1位  Googleトレンドで ここ数年検索上昇中  扱いに慣れるまでが大変  付属機能が山盛り  学習コストはちょい高め? 2019/10/25 プロ生第60回 名古屋 5
  • 6. Laradock について  Laradock is a full PHP development environment based on Docker.  名前の通り Laravel の開発環境を Docker 上で簡単作っちゃおうぜのプロジェクト  現在は Laravel のみならず、Symfony, WordPress などの開発も楽にできるようになってる  中身としては docker-compose のファイルが入っている  env ファイル があるので、好きにいじって、お好みのコンテナを起動させる  あとは docker-compose がよしなに環境設定してくれて、いきなり開発開始! 2019/10/25 プロ生第60回 名古屋 6
  • 7. Laradock の超簡単使い方  これだけで nginx / mysql / phpMyAdmin / Redis / workspace のコンテナが起動  実行する PHP プロジェクトは workspace に配置されるので、 対象PHP プロジェクトの .env 等に DB_HOST=mysql / REDIS_HOST=redis などを 記載しておけば、すぐに先程起動したmysqlコンテナの DB が使える  コンテナ内は hosts がその名前(mysqlなど)で設定されているので、上記の設定でOK $ git clone https://github.com/Laradock/laradock.git $ cd laradock $ cp env-example .env $ docker-compose up –d nginx mysql phpmyadmin redis workspace 2019/10/25 プロ生第60回 名古屋 7
  • 8. Laradock の超簡単使い方  Laravel セットアップ  workspace コンテナ内にコードを配置する  .envで指定したパスが workspace 内コンテナと共有される  workspace コンテナには、Laravel をインストールするための composer などがセットアップ済み  一度コンテナ内で Laravel プロジェクトを作成して、そのパスを.envで指定するのが良さそう  Laradock の .envファイルでアプリケーションパスを修正し、コンテナを再起動 2019/10/25 プロ生第60回 名古屋 8 $ docker exec -it laradock_workspace_1 /bin/bash # composer create-project --prefer-dist laravel/laravel application APP_CODE_PATH_HOST=../application
  • 9. Laradock の超簡単使い方  他にも・・・  PHP のバージョンは複数から自由に選べる  対応しているコンテナは数十種類もあるので、ぶっちゃけ PHP に限らずかなり使える  Laravel には公式ツールの Homestead というもの(こちらは仮想サーバーを立ち上げる) があるが、デプロイ等を考えると、コンテナでの開発の方が効率は良さそう?  どこか不具合が起きたら、そのコンテナのみ作り直す、などもできるしね 2019/10/25 プロ生第60回 名古屋 9
  • 10. まとめ  とりあえず Laravel 触ってみたい人、 Webアプリケーションを作ってみたい人は、使ってみたら良いと思います!  関係ないけど、WSL2 で docker が使えるようになるので、 ますます開発がしやすくなりますね!  xdebug でのブレークポイント開発ももちろん可能  詳しくはブログ記事をどうぞ  Laradock + Laravel + VSCode + Xdebug 環境構築 https://blog.naba.biz/entry/2019/06/30/013349 2019/10/25 プロ生第60回 名古屋 10