Giter Site home page Giter Site logo

springkjw / laravel-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leborgne-alexandre/laravel-docker

0.0 2.0 0.0 36 KB

Laravel mounted inside a Dockerized environment

Home Page: http://laravel.local

License: GNU General Public License v3.0

Makefile 46.35% Dockerfile 53.65%

laravel-docker's Introduction

laravel-docker

Featuring

  • PHP with FPM configured out-of-the-box.
  • NGINX configured to work in coordination with PHP FPM.
  • Laravel installer with a fix for the Laravel's logs & cache folder permissions issues.
  • PostgreSQL configured with automatic creation of the necessary database.
  • Elegants urls like laravel.local & database.laravel.local for easily test & debug your application.

Requirements

Requirement Optional
Text editor No
Command prompt / Terminal emulator No
Git command line interface No
Docker No
Docker Compose No
GNU/Make Yes

Installation

$ git clone https://github.com/aminnairi/laravel-docker my-laravel-project
$ cd my-laravel-project

DNS configuration (optional, recommended)

$ sudo $EDITOR /etc/hosts                       # OS X & GNU/Linux users
> $EDITOR C:\Windows\System32\Drivers\etc\hosts # Windows users

Replace $EDITOR with you favorite text editor. Append this line at the end.

127.0.0.1   laravel.local           www.laravel.local
127.0.0.1   database.laravel.local

This will make you able to access your website from either http://laravel.local/ or http://www.laravel.local/.

Laravel Installation

$ make install                      # OS X & GNU/Linux users
$ docker-compose run --rm install   # all users

Laravel's source-files will be located under the laravel folder.

Start

$ make start                                        # OS X & GNU/Linux users
$ docker-compose up -d php nginx postgres adminer   # all users
Target IP Address/Domain Requires DNS Configuration
Website http://127.0.0.1/ No
Website http://localhost/ No
Website http://laravel.local/ Yes
Website http://www.laravel.local/ Yes
Database Administration http://127.0.0.1:8080/ No
Database Administration http://localhost:8080/ No
Database Administration http://laravel.local:8080/ Yes
Database Administration http://www.laravel.local:8080/ Yes
Database Administration http://database.laravel.local/ Yes

Database administration's credentials:

Field Value
System PostgreSQL
Server postgres
Username root
Password root
Database laravel

Stop

$ make stop             # OS X & GNU/Linux users
$ docker-compose down   # all users

This will stop the database, PHP & the NGINX servers.

Laravel Artisan Commands

$ make shell                                    # OS X & GNU/Linux users
$ docker-compose exec -u 1000:1000 php bash     # all users

You are now a Laravel Artisan. Try some commands.

$ php artisan help

See Laravel Artisan Console for more informations.

Template Update

$ make update               # OS X & GNU/Linux users
$ git pull origin master    # all users

The laravel folder will remain untouched. Only Docker related files that are listed in this repository will be updated.

laravel-docker's People

Contributors

aminnairi avatar

Watchers

 avatar  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.