A docker-compose workflow that sets up a LAMP software bundle of containers for local development.
To get started, make sure you have Docker installed on your system, and then clone this repository.
Open a terminal and run docker-compose up -d --build
. Open up your browser of choice to http://localhost and you should see the your app running as intended.
Containers created and their ports (if used) are as follows:
- apache -
80:80
- mysql -
:3306
- phpMyAdmin -
:8080
- MailHog -
:8025
- Clone or download this repository. Ideally somewhere where docker has write access. For example in the
/Users/*
directory. (macOS) - Go to your root directory and the
/docker/
directory in it. (The directory in which thedocker-compose.yml
is located). Open a terminal and rundocker-compose up -d --build
. - Open a browser of your choice and go to the following URL: http://localhost. You should see your app running as intended.
- Now we need to open a shell at the web server. To do this, go back to your terminal and run
docker-compose exec development bash
. It should be noted at this point that we communicate with the web server via Docker. That means to talk to the web server we use thedocker-compose.yml
. To do this we have to be in the/docker/
directory in which thedocker-compose.yml
is located. - The first thing we need to take care of is to install Composer. To do this, run
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:php artisan key:generate
- Next, run
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:
php artisan migrate —seed
Maybe this process is uncompleted. If so please let me know and i will take care of it.
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. php artisan telescope:install
2. php artisan migrate
You can reach telesope at the following URL: http://localhost/telescope
- dc -
docker-compose
- dce -
docker-compose exec development bash
To use it put the following into your ~/.zshrc
:
alias dc="docker-compose"
alias dce="docker-compose exec development bash"
I'm pretty sure you can use it in every other shell in a similar way.
This project is based on florian dehn's php docker runtime: https://github.com/katzefudder/docker_php_runtime