GithubHelp home page GithubHelp logo

docker-laravel-5.3's Introduction

A Docker image and docker-compose config for quickly setting up an environment with Laravel 5.3.

Inspired by Bitnami's project but I had problems trying to figure out how to do some things and I wanted to learn Docker so I started from scratch and learnt stuff while creating it step-by-step.

Quick start

Copy the docker-compose.yml file to your computer. Now run:

docker-compose up -d

docker-compose exec app setup-laravel

You should have a working Laravel app on http://localhost (or your docker machine's address/ip).

If you want to create the basic authentication scaffolding, you can now run:

docker-compose exec app php artisan make:auth
docker-compose exec app php artisan migrate

Similarly, most commands should be run in the container. You can run some directly on your machine, for instance if you have composer, you should be able to use it without prefixing it with "docker-compose exec app". But npm install will certainly need to be run in the container, the same with any artisan commands that access the database etc., you get the picture.

Containers

As you'll see in docker-compose.yml this environment consists of

  • the app server image
  • a vanilla MySQL image

Software

Most importantly:

  • Laravel 5.3
  • Laravel Elixir
  • Nginx
  • PHP (obviously)
  • MySQL (in the separate image)

Also featured:

  • nodejs
  • npm
  • git
  • composer
  • gulp
  • bower
  • vim
  • curl

User and app folder setup

There's a user called deploy with passwordless sudo privileges.

The folder for the app is in this user's home folder: /home/deploy/public/app

node_modules and vendor/bin are only accessible in the container because they contain symlinks which causes problems on Windows.

Running commands

The current user in the container is deploy and the working directory is /home/deploy/public/app, so you can do this for instance:

docker-compose exec app php artisan --version

The deploy user has passwordless sudo.

docker-laravel-5.3's People

Contributors

rafalglowacz avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.