Kickstart your development environment with this guide.
The current Docker environment is based on Docker Toolbox. If you don't have Docker Toolbox installed, you can download it here.
To generate a virtual machine, run the following command anywhere in your terminal:
docker-machine create default --driver=virtualbox
To prevent permission problems we leverage Docker-Machine-NFS to mount volumes as NFS. First, install docker-machine-nfs and then run the following command:
docker-machine-nfs default --nfs-config="-alldirs -maproot=0" --mount-opts="noacl,async,nolock,vers=3,udp,noatime,actimeo=1"
As a final step, load the docker-machine:
eval $(docker-machine env default)
The development stack will expose the following domains:
- simplerestchat.dev - the URL of application
These domains need to be added to the /etc/hosts files. First look up the ip-address of your Docker VM:
docker-machine ip $(docker-machine active)
Next, open the hosts file
sudo nano /etc/hosts
Append the following line to the file (change the ip-address to your Docker VM's ip):
192.168.99.100 simplerestchat.dev
To install all composer dependencies, run the following command:
docker run --rm -v $(PWD):/app -v $($HOME)/.composer:/composer --user $(id -u):$(id -g) composer install --optimize-autoloader --no-interaction --no-progress --no-scripts
Create the required network in order to communicate with the reverse proxy:
docker network create traefik_bridge_gateway --driver bridge
From the root directory of the repository, create a Docker Registry which will host our images:
docker-compose -f docker-compose.local.yml up -d registry
Next, build the App image (Multistage build):
docker-compose -f docker-compose.local.yml build
After the image was build successfully, push it to the registry:
docker-compose -f docker-compose.local.yml push
Now the image has been pushed to the registry, we can start the development stack with:
docker-compose -f docker-compose.local.yml up -d
touch database/database.sqlite
Create an .env
file and set your enviroment variables.
There is an .env.example
file in order to help you.
To migrate the database, run the following through the command-line:
php artisan migrate
To seed the database, run the following through the command-line:
php artisan db:seed
Try:
open http://simplerestchat.dev
You should see the Laravel Lumen homepage with the version information
Get your Postman ready