Giter Club home page Giter Club logo

laravel-lumen-docker's Introduction

Laravel/Lumen Docker Scaffold

Description

This will create a dockerized stack for a Laravel/Lumen application, consisted of the following containers:

  • app, your PHP application container

     Nginx, PHP7.4 PHP7.4-fpm, Composer, NPM, Node.js v10.x
    
  • mysql, MySQL database container (mysql official Docker image)

Directory Structure

+-- src <project root>
+-- resources
|   +-- default
|   +-- nginx.conf
|   +-- supervisord.conf
|   +-- www.conf
+-- .gitignore
+-- Dockerfile
+-- docker-compose.yml
+-- readme.md <this file>

Setup instructions

Prerequisites:

Installation steps:

  1. Create a new directory in which your OS user has full read/write access and clone this repository inside.

  2. Create two new textfiles named db_root_password.txt and db_password.txt and place your preferred database passwords inside:

    $ echo "myrootpass" > db_root_password.txt
    $ echo "myuserpass" > db_password.txt
    
  3. Open a new terminal/CMD, navigate to this repository root (where docker-compose.yml exists) and execute the following command:

    $ docker-compose up -d
    

    This will download/build all the required images and start the stack containers. It usually takes a bit of time, so grab a cup of coffee.

  4. After the whole stack is up, enter the app container and install the framework of your choice:

    Laravel

    $ docker exec -it app bash
    $ composer create-project --prefer-dist laravel/laravel .
    $ nano .env
    $ php artisan migrate --seed
    

    Lumen

    $ docker exec -it app bash
    $ composer create-project --prefer-dist laravel/lumen .
    $ nano .env
    $ php artisan migrate --seed
    
  5. That's it! Navigate to http://localhost to access the application.

Default configuration values

The following values should be replaced in your .env file if you're willing to keep them as defaults:

DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=appdb
DB_USERNAME=user
DB_PASSWORD=myuserpass

laravel-lumen-docker's People

Contributors

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