Build docker + laravel environment with laradock

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.

Environment

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.

Launch Laradock

In the directory where /laradock (docker-compose.yml) is located

$ docker-compose up -d nginx mysql workspace phpmyadmin

To execute.

Create a Laravel project.

$ 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.

A little addicted

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

Build docker + laravel environment with laradock
Build docker environment with WSL
Build a Laravel / Docker environment with VSCode devcontainer
Build Couchbase local environment with Docker
Build a Node.js environment with Docker
Laravel + Docker Laradock usage environment construction
Build PlantUML environment with VSCode + Docker
Build environment with vue.js + rails + docker
Build Rails environment with Docker Compose
Create Laravel environment with Docker (docker-compose)
Laravel development environment construction with Docker (Mac)
Build a PureScript development environment with Docker
Environment construction with Docker (Ubuntu20.04) + Laravel + nginx
Laravel + MySQL + phpMyadmin environment construction with Docker
Build a Wordpress development environment with Docker
[Docker] Build Jupyter Lab execution environment with Docker
Build an environment with Docker on AWS
Build TensorFlow operation check environment with Docker
How to build Rails 6 environment with Docker
Build a WordPress development environment quickly with Docker
Build mecab (NEologd dictionary) environment with Docker (ubuntu)
[Rails] How to build an environment with Docker
[First team development ②] Build an environment with Docker
[Copy and paste] Build a Laravel development environment with Docker Compose Part 2
[Copy and paste] Build a Laravel development environment with Docker Compose Participation
Pytorch execution environment with Docker
Deploy with EC2 / Docker / Laravel
[Docker] Rails 5.2 environment construction with docker
React environment construction with Docker
Build DynamoDB local with Docker
Build an environment of Ruby2.7.x + Rails6.0.x + MySQL8.0.x with Docker
Easily build a Vue.js environment with Docker + Vue CLI
Build Docker + Laravel PHP + Vue.js development environment in 5 minutes
[Note] Build a Python3 environment with Docker in EC2
Build Java development environment with WSL2 Docker VS Code
Build Rails (API) x MySQL x Nuxt.js environment with Docker
Build WordPress environment with Docker (Local) and AWS (Production)
Rails + MySQL environment construction with Docker
Create a Vue3 environment with Docker!
Node.js environment construction with Docker Compose
Build a Tomcat 8.5 environment with Pleiades 4.8
Environment construction with Docker for beginners
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Express ~
[Portfolio] Manage site with laravel APP implementation (Docker environment construction)
General error: 1812 occurs with docker + laravel
Create SolrCloud verification environment with Docker
Install laravel/Dusk in docker environment (laravel6)
How to build Rails, Postgres, ElasticSearch development environment with Docker
Build a Node-RED environment with Docker to move and understand
[Environment construction with Docker] Rails 6 & MySQL 8
Build Unity development environment on docker
Build WebRTC Janus with Docker container
Spring Boot gradle build with Docker
Build apache7.4 + mysql8 environment with Docker (with initial data) (your own memo)
Build a SPA for Laravel 6.2 / Vue.js / Nginx / Mysql / Redis with Docker
If npm run build slows down under Docker, Laravel, node environment
I tried to build the environment of PlantUML Server with Docker
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ MySQL edition ~
How to build Rails + Vue + MySQL environment with Docker [2020/09 latest version]
Build a development environment for Django + MySQL + nginx with Docker Compose
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Sequelize ~