A docker-compose workflow that sets up a LEMP software bundle of containers for local development.
To get started, make sure you have Docker installed on your system, and then clone this repository.
Go to your root directory and the /docker/ directory in it. (The directory in which the docker-compose.yml is located). Open a terminal and run docker-compose up -d --build
. Open up your browser of choice to http://localhost:8080 and you should see your app running as intended.
The following containers that handle Composer, NPM, and Artisan commands without having to have these platforms installed on your local computer. Use the following command templates inside your project root.
docker-compose run --rm composer update
docker-compose run --rm npm run dev
docker-compose run --rm artisan migrate
Containers created and their ports (if used) are as follows:
- nginx -
:8080
- mysql -
:3306
- php -
:9000
- phpMyAdmin -
:8082
- MailDev -
:8081
- npm
- composer
- artisan
For this tutorial i will use my bash alias as described below.
- Clone or download this repository. Ideally somewhere where docker has write access. For example in the
/Users
directory. (macOS) - Set up docker as described above and go to your project root. (The directory in which the
docker-compose.yml
is located) - Open a browser of your choice and go to the following URL: http://localhost:8080
- The first thing we need to take care of is to install Composer. To do this, run
dcr install composer
- Next, copy the
.env.example
and delete the word.example
from the file name. So that you only have one.env
. - Now we have to create a key for the
.env
. To do this, execute the following command:dca key:generate
- Next, run
dcr npm install
to install all packages from thepackage.json
- The last thing we need to do is migrate the database. To do this, run the following command:
dca migrate —seed
Maybe this process is uncompleted. If so please let me know and i will take care of it.
- dc -
docker-compose
- dcr -
docker-compose run --rm
- dca -
docker-compose run --rm artisan
To use it put the following into your ~/.zshrc
:
alias dc="docker-compose"
alias dcr="docker-compose run --rm"
alias dca="docker-compose run --rm artisan"
I'm pretty sure you can use it in every other shell in a similar way.
Laravel Telescope is an elegant debug assistant for the Laravel framework. Telescope provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps and more. Telescope makes a wonderful companion to your local Laravel development environment.
Telescope is preconfigured, if you wanne use it execute the following commands.
1. dca telescope:install
2. dca migrate
You can reach telesope at the following URL: http://localhost:8080/telescope