Laravel & Docker, Zero config with Vesselby@yjose
4,232 reads
4,232 reads

Laravel & Docker, Zero config with Vessel

by Youssouf El AziziNovember 12th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

<span>It</span> is a long time that I am a big fan of chris fideo the author of <a href="" target="_blank">servers for hackers&nbsp;</a>,one of the most rich source of content to learn server’s configurations&nbsp;, security&nbsp;,database,docker and much more DevOps topics.

People Mentioned

Mention Thumbnail
featured image - Laravel & Docker, Zero config with Vessel
Youssouf El Azizi HackerNoon profile picture

Laravel & docker

This article is a step-by-step to get started with Vessel ( the new way to setup the Laravel setup config with docker).

If your are not familiar with docker you can check my last article “ A step by step guide to setup PHP (Laravel) environment (Linux)”.

It is a long time that I am a big fan of chris fideo the author of servers for hackers ,one of the most rich source of content to learn server’s configurations , security ,database,docker and much more DevOps topics.

Dockerizing your Application is one of the amazing free course, it’s a step-by-step docker workflow to develop a breeze for your application. According to Chris,Vessel is the result of this docker workflow more is an official that everyone could easily use.

Let’s give it a try

Vessel is a lightweight docker environment for Laravel, that means it is just a small set of files that set up a local docker development environment per project and there is no extra thing to install globally, expect Docker system itself.

Install Docker and Docker-compose

Docker is an open source project based on Linux container, if you are not familiar yet with docker, this article “ A Beginner-Friendly Introduction to Containers, VMs and Docker ” by Preethi Kasireddy is the ideal place to take your first step.

At this moment Vessel only works on Mac and Linux because it uses a bash script to run Docker commands.

For Linux Ubuntu distribution the easiest way to install docker is by the following:

curl -fsSL | sudo shsudo usermod -aG docker your-user // add your user to docker group

To Install docker compose run this command to download the latest version :

sudo curl -L`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

Next,Apply executable permissions to the binary.

sudo chmod +x /usr/local/bin/docker-compose

Learn more about docker installation : docker , docker-compose

Get Started with Vessel

First you need to create a Laravel project to start with by the following :

composer create-project — prefer-dist laravel/laravel vessel_test

Now and as I mention before Vessel is lightweight docker environment includes a Laravel service provider that makes easy and simple to start your own development setup. All you need to do in order to start your dev setup with vessel :

# Install Vessel into your projectcomposer require shipping-docker/vessel

# Publish the `vessel` command and Docker filesphp artisan vendor:publish — provider=”Vessel\VesselServiceProvider”

# Run this once to initialize project# Must run with “bash” until initializedbash vessel init

The first time you start up an application with Vessel using the init command, vessel will download the following official Docker images:

  • PHP 7.1
  • MySQL 5.7
  • Redis
  • NodeJS with NPM, Yarn, and Gulp

Start vessel by running :

cd vessel_test./vessel start

Head to http://localhost in your browser and see your Laravel site!

And at last, also Vessel has good documentation that covers everything you need to know to get started : official documentation

Bonus : Vessel Cheat Sheet

Thanks for reading! If you think other people should read this, clap for me, tweet and share the post. Remember to follow me on Medium so you can get notified about my future posts.

Read more stories

P.P.S. if you liked this,give me at least dozen claps for good luck 👌👌.