It may be new, but since I built the environment with Laradock, I will write it as a memorandum. The OS of the PC is Linux Ubuntu 18.0.4.
Clone the repository to your working directory.
$ mkdir myworkspace
$ cd myworkspace
$ git clone https://github.com/LaraDock/laradock.git
We will set environment variables. Since there is .env.example, copy this and change it according to your environment.
$ cp env-example .env
When I set it for the first time, the connection information of .env of this docker-compose and MySqlDB of .env of laravel I wrote it separately and was a little addicted to it, so be careful when setting it.
By default, the version setting of MySql is latest, but let's change it if necessary.
MYSQL_VERSION=5.7
There are many other articles, so please refer to them as well.
In the directory where /laradock (docker-compose.yml) is located
$ docker-compose up -d nginx mysql workspace phpmyadmin
To execute.
$ docker-compose exec --user=laradock workspace bash
laradock@5cf89da63592:/var/www$
laradock@5cf89da63592:/var/www$ composer create-project laravel/laravel develop --prefer-dist "version"
Is OK. Match the DB settings of Laravel's .env with Laravel's .env.
On the login screen of phpmyadmin, an input field called server appeared. I haven't seen it before, but it seems that I should put the host of the server to connect to. (If you make a mistake, please let us know in the comments.)
DB_HOST is set to mysql in the larvel settings, so you can enter it (mysql).
Recommended Posts