1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【2】IntelliJ+Laravel+Vuejs+Docker+Mysqlの環境構築

Last updated at Posted at 2019-07-23

今回もlaradockを使っての構築。
前回の環境にdocker mysqlを導入する。

gitも載せとく。
https://github.com/miyamotok0105/laravel_sample/tree/master/docker_sample2/005laravel-lig

git clone https://github.com/Laradock/laradock.git
mkdir src
cd laradock
cp env-example .env

APP_CODE_PATH_HOSTはアプリケーションのディレクトリパス。
DATA_PATH_HOSTはプロジェクトのデータ管理場所。
COMPOSE_PROJECT_NAMEはdokcerのコンテナ名。
MYSQL_VERSIONはmysqlのバージョン。

APP_CODE_PATH_HOST=../src/
DATA_PATH_HOST=../.laradock/data
COMPOSE_PROJECT_NAME=laradock-project_name
MYSQL_VERSION=5.7

docker起動。

docker-compose up -d nginx mysql phpmyadmin

Laravelインストール

docker-compose exec workspace bash
composer create-project --prefer-dist laravel/laravel ./

Laravelの設定

laradock_project_name/src/.env
DB_HOST=mysql
DB_DATABASE=default
DB_USERNAME=default
DB_PASSWORD=secret

コマンドでmysql接続

サーバ: mysql
ユーザー名: default
パスワード: secret

docker-compose exec workspace bash
mysql -u default -p

phpadminで接続

アクセス
http://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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?