LoginSignup
1
0

More than 3 years have passed since last update.

Windows10でDocker + Laravel環境構築メモ

Posted at

Hyper-Vの有効化

Docker for Windowsのインストール

  • Shared Drive
  • 作業フォルダ作成
  • cd 作業フォルダ
  • git clone https://github.com/laradock/laradock.git
  • cd laradock
  • env-example コピー作成してリネーム -> .env
  • Dockerコンテナ起動 docker-compose up -d nginx postgres workspace
  • コンテナに接続 docker-compose exec --user=laradock workspace bash

Laravelプロジェクト作成

  • composer create-project --prefer-dist laravel/laravel laravel-project
  • 一旦コンテナから抜けます exit
  • laradockディレクトリ内の.envファイルを開き、以下の通りに書き換えます。
    • APP_CODE_PATH_HOST=.. -> APP_CODE_PATH_HOST=../laravel-project/
  • docker-compose stop
  • docker-compose up -d nginx postgres workspace

localhostにアクセス

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0