Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
7
Help us understand the problem. What is going on with this article?
@tomborius

Laradock開発環境構築

More than 1 year has passed since last update.

Laradockを使って開発環境の構築を初めてしたので備忘。

環境

・MacBook Pro
・macOS High Sierra
・apache2
・phpmyadmin
・mariadb

Laradockクローン

ルートディレクトリにて、下記を実行。

$ git clone https://github.com/LaraDock/laradock.git

.envをenv-exampleからコピーして作成。

$ cd laradock
$ cp env-example .env

プロジェクト作成

まずは、ワークスペースを起動。

$ cd laradock
$ docker-compose up -d workspace

ワークスペースに入る。

$ docker-compose exec workspace bash

Laravelのプロジェクトを作成

# composer create-project laravel/laravel new_project

dockerを一旦終了

# exit
$ docker-compose down

laradock/.envのpathを作成したプロジェクトに変更。
今回はmariadbを使用するので、phpmyadminのPMA_DB_ENGINEも変更。

# Point to the path of your applications code on your host
APP_CODE_PATH_HOST=../new_project

# Accepted values: mariadb - mysql
PMA_DB_ENGINE=mariadb

apache2の設定変更

ハマったところ。

apache2を使用するので、laradock/apache2/sites/default.apache.confを変更。

ServerName localhost
DocumentRoot /var/www/public/
Options Indexes FollowSymLinks

<Directory "/var/www/public/">

dockerにてコンテナを起動。

$ docker-compose up -d mariadb apache2 phpmyadmin

localhostにアクセス。

screencapture-localhost-2018-10-05-00_21_24.png

phpmyadminはlocalhost:8080へ。
screencapture-localhost-8080-sql-php-2018-10-05-00_25_20.png

Enjoy Laravel!!

DBの作成

※後日追記※

7
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
7
Help us understand the problem. What is going on with this article?